Ignore:
Timestamp:
Aug 31, 2006, 5:09:20 PM (18 years ago)
Author:
Bruno Cornec
Message:
  • Massive rewrite continues for memory management.
  • main structure should now have all parameters allocated dynamically
  • new lib libmr.a + dir + build process reviewed to support it.
  • new include subdir to host external definitions of the new lib
  • code now compiles. Still one remaining link issues for mondorestore. This should allow for some tests soon.

(goal is to separate completely reviewed code and functions and provide clean interfaces)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondorestore/mondo-rstr-compare.c

    r689 r783  
    44
    55
    6 #include "../common/my-stuff.h"
     6#include "my-stuff.h"
    77#include "../common/mondostructures.h"
    88#include "../common/libmondo.h"
     
    4444    char *p = NULL;
    4545    int i = 0;
    46     int n = 0;
     46    size_t n = 0;
    4747    int retval = 0;
    4848
     
    258258        }
    259259        paranoid_free(tmp);
     260
    260261        if (use_star) {
    261262            if (strcmp(compressor_exe, "bzip2")) {
     
    264265            }
    265266        } else {
    266             asprintf(&tmp, compressor_exe);
    267             sprintf(compressor_exe, "-P %s -Z", tmp);
     267            tmp = compressor_exe;
     268            asprintf(&compressor_exe, "-P %s -Z", tmp);
    268269            paranoid_free(tmp);
    269270        }
     
    299300        log_OS_error(command);
    300301    }
     302    paranoid_free(command);
     303
    301304    if (length_of_file(logfile) > 5) {
    302         sprintf(command,
     305        asprintf(&command,
    303306                "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vx \"dev/.*\" >> /tmp/changed.txt",
    304307                logfile);
    305308        system(command);
     309        paranoid_free(command);
    306310        archiver_errors = count_lines_in_file(logfile);
    307311    } else {
    308312        archiver_errors = 0;
    309313    }
    310     paranoid_free(command);
    311314
    312315    if (archiver_errors) {
     
    353356
    354357    asprintf(&progress_str, _("Comparing with %s #%d "),
    355             media_descriptor_string(bkpinfo->backup_media_type),
     358            bkpinfo->backup_media_string,
    356359            g_current_media_number);
    357360
     
    402405            paranoid_free(progress_str);
    403406            asprintf(&progress_str, _("Comparing with %s #%d "),
    404                     media_descriptor_string(bkpinfo->backup_media_type),
     407                    bkpinfo->backup_media_string,
    405408                    g_current_media_number);
    406409            log_to_screen(progress_str);
Note: See TracChangeset for help on using the changeset viewer.