Ignore:
Timestamp:
Aug 28, 2009, 2:46:29 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 (backport from 2.2.9)

File:
1 edited

Legend:

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

    r2331 r2352  
    519519 * @see evaluate_drive_within_mountlist
    520520 */
    521 int
    522 evaluate_mountlist(struct mountlist_itself *mountlist, char *flaws_str_A,
    523                    char *flaws_str_B, char *flaws_str_C)
    524 {
     521char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res) {
    525522
    526523    /*@ buffer *********************************************************** */
     
    531528    /*@ int ************************************************************** */
    532529    int i = 0;
    533     int res = 0;
    534530
    535531    /*@ initialize ******************************************************* */
    536532
     533    *res = 0;
    537534    drivelist = malloc(sizeof(struct list_of_disks));
    538535    assert(mountlist != NULL);
    539     assert(flaws_str_A != NULL);
    540     assert(flaws_str_B != NULL);
    541     assert(flaws_str_C != NULL);
    542536
    543537    mr_asprintf(flaws_str, "%s", "");
     
    556550            tmp = evaluate_drive_within_mountlist(mountlist, drivelist->el[i].device);
    557551            if (tmp == NULL) {
    558                 res++;
     552                (*res)++;
    559553            }
    560554        }
     
    567561        }
    568562    }
    569     res += look_for_duplicate_mountpoints(mountlist, flaws_str);
    570     res = spread_flaws_across_three_lines(flaws_str, flaws_str_A, flaws_str_B, flaws_str_C,res);
    571     mr_free(flaws_str);
    572     return(res);
     563    *res += look_for_duplicate_mountpoints(mountlist, flaws_str);
     564    return(flaws_str);
    573565}
    574566
Note: See TracChangeset for help on using the changeset viewer.