Ignore:
Timestamp:
Aug 28, 2009, 2:24:19 AM (15 years ago)
Author:
Bruno Cornec
Message:

Change inerface of evaluate_mountlist and spread_flaws_across_three_lines in order to solve bugs linked to strings management in these functions. May fix a restoration crash seen by some customers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-mountlist.c

    r2304 r2350  
    500500 * @see evaluate_drive_within_mountlist
    501501 */
    502 int
    503 evaluate_mountlist(struct mountlist_itself *mountlist, char *flaws_str_A,
    504                    char *flaws_str_B, char *flaws_str_C)
    505 {
     502char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res) {
    506503
    507504    /*@ buffer *********************************************************** */
     
    512509    /*@ int ************************************************************** */
    513510    int i = 0;
    514     int res = 0;
    515511
    516512    /*@ initialize ******************************************************* */
    517513
     514    *res = 0;
    518515    drivelist = malloc(sizeof(struct list_of_disks));
    519516    assert(mountlist != NULL);
    520     assert(flaws_str_A != NULL);
    521     assert(flaws_str_B != NULL);
    522     assert(flaws_str_C != NULL);
    523517
    524518    mr_asprintf(&flaws_str, "%s", "");
     
    539533            tmp = evaluate_drive_within_mountlist(mountlist, drivelist->el[i].device);
    540534            if (tmp == NULL) {
    541                 res++;
     535                (*res)++;
    542536            }
    543537        }
     
    550544        }
    551545    }
    552     res += look_for_duplicate_mountpoints(mountlist, flaws_str);
    553     res = spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C,res);
    554     paranoid_free(flaws_str);
    555     return(res);
     546    *res += look_for_duplicate_mountpoints(mountlist, flaws_str);
     547    return(flaws_str);
    556548}
    557549
Note: See TracChangeset for help on using the changeset viewer.