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

    r2338 r2352  
    752752  /** malloc **/
    753753    char *tmp = NULL;
    754     char *tmpA = NULL;
    755     char *tmpB = NULL;
    756     char *tmpC = NULL;
     754    char *flaws_str = NULL;
    757755
    758756    assert(bkpinfo != NULL);
    759757    assert(mountlist != NULL);
    760758    assert(raidlist != NULL);
    761 
    762     mr_asprintf(tmpA, "%s", "         ");
    763     mr_asprintf(tmpB, "%s", "         ");
    764     mr_asprintf(tmpC, "%s", "         ");
    765759
    766760    log_msg(2, "nuke_mode --- starting");
     
    773767        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
    774768    }
    775     if (!evaluate_mountlist(mountlist, tmpA, tmpB, tmpC)) {
    776         mr_asprintf(tmp, "Mountlist analyzed. Result: \"%s %s %s\" Switch to Interactive Mode?", tmpA, tmpB, tmpC);
     769    flaws_str = evaluate_mountlist(mountlist, &res);
     770    if (!res) {
     771        mr_asprintf(tmp, "Mountlist analyzed. Result: \"%s\" Switch to Interactive Mode?", flaws_str);
     772        mr_free(flaws_str);
    777773        res = ask_me_yes_or_no(tmp);
    778774        mr_free(tmp);
     
    784780        }
    785781    }
     782    mr_free(flaws_str);
     783
    786784    save_mountlist_to_disk(mountlist, g_mountlist_fname);
    787785    mvaddstr_and_log_it(1, 30, "Restoring Automatically");
Note: See TracChangeset for help on using the changeset viewer.