Changeset 783 in MondoRescue for trunk/mondo/mondo/common/libmondo-filelist.c


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/common/libmondo-filelist.c

    r729 r783  
    266266            i = 0;
    267267        }
    268         /* BERLIOS: Useless with getline
    269            if (i > MAX_STR_LEN - 1) {
    270            incoming[MAX_STR_LEN - 30] = '\0';
    271            log_msg(1, "Warning - truncating file %s's name", incoming);
    272            err++;
    273            }
    274          */
    275268        if (incoming[i] < 32) {
    276269            incoming[i] = '\0';
     
    717710{
    718711    /*@ buffers ***************************************************** */
    719     char val_sz[MAX_STR_LEN];
    720     char *cfg_fname;
     712    char *val_sz = NULL;
     713    char *cfg_fname = NULL;
    721714
    722715    /*@ long ******************************************************** */
    723     int val_i;
     716    int val_i = 0;
    724717
    725718    /*@ end vars **************************************************** */
     
    730723    read_cfg_var(cfg_fname, "last-filelist-number", val_sz);
    731724    val_i = atoi(val_sz);
     725    paranoid_free(val_sz);
     726
    732727    if (val_i <= 0) {
    733728        val_i = 500;
     
    13561351        asprintf(&tmp,
    13571352                "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",
    1358                  dir, MAX_SKEL_DEPTH, g_skeleton_filelist);
     1353                 dir, MAX_SKEL_DEPTH, skeleton_filelist);
    13591354#else
    13601355        // On BSD, for example, /sys is the kernel sources -- don't exclude
    13611356        asprintf(&tmp,
    13621357                "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o -type d -a -print > %s 2> /dev/null",
    1363                  dir, MAX_SKEL_DEPTH, g_skeleton_filelist);
     1358                 dir, MAX_SKEL_DEPTH, skeleton_filelist);
    13641359#endif
    13651360        system(tmp);
     
    14351430            /* BERLIOS: Old code
    14361431               new_with_spaces[0] = ' ';
    1437                strcpy(new_with_spaces + 1, new);
    1438                strcat(new_with_spaces, " ");
     1432               str-cpy(new_with_spaces + 1, new);
     1433               str-cat(new_with_spaces, " ");
    14391434             */
    14401435            if (strstr(skip_these, new_with_spaces)) {
     
    15041499{
    15051500    static char sz_res[MAX_STR_LEN];
    1506     char *p;
     1501    char *p = NULL;
    15071502    bool in_quotes = FALSE;
    15081503
Note: See TracChangeset for help on using the changeset viewer.