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/mondorestore/mondorestore.c

    r2290 r2350  
    777777  /** malloc **/
    778778    char tmp[MAX_STR_LEN];
    779     char *tmpA;
    780     char *tmpB;
    781     char *tmpC;
     779    char *flaws_str = NULL;
    782780
    783781    assert(bkpinfo != NULL);
    784782    assert(mountlist != NULL);
    785783    assert(raidlist != NULL);
    786 
    787     mr_asprintf(&tmpA, "%s", "         ");
    788     mr_asprintf(&tmpB, "%s", "         ");
    789     mr_asprintf(&tmpC, "%s", "         ");
    790784
    791785    log_msg(2, "nuke_mode --- starting");
     
    807801        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
    808802    }
    809     if (!evaluate_mountlist(mountlist, tmpA, tmpB, tmpC)) {
     803    flaws_str = evaluate_mountlist(mountlist, &res);
     804    if (!res) {
    810805        sprintf(tmp,
    811                 "Mountlist analyzed. Result: \"%s %s %s\" Switch to Interactive Mode?",
    812                 tmpA, tmpB, tmpC);
     806                "Mountlist analyzed. Result: \"%s\" Switch to Interactive Mode?",
     807                flaws_str);
     808        mr_free(flaws_str);
    813809        if (ask_me_yes_or_no(tmp)) {
    814810            retval = interactive_mode(mountlist, raidlist);
     
    818814        }
    819815    }
     816    mr_free(flaws_str);
     817
    820818    save_mountlist_to_disk(mountlist, g_mountlist_fname);
    821819    mvaddstr_and_log_it(1, 30, "Restoring Automatically");
Note: See TracChangeset for help on using the changeset viewer.