Changeset 2394 in MondoRescue for branches/2.2.9


Ignore:
Timestamp:
Sep 12, 2009, 2:53:02 AM (15 years ago)
Author:
Bruno Cornec
Message:

Fix interface of evaluate_mountlist (remove 2nd param useless) and fix nuke mode which wasn't working.

Location:
branches/2.2.9/mondo
Files:
8 edited

Legend:

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

    r2384 r2394  
    11/* libmondo-mountlist-EXT.h */
    22
    3 extern char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res);
     3extern char *evaluate_mountlist(struct mountlist_itself *mountlist);
    44extern int find_device_in_mountlist(struct mountlist_itself *mountlist,
    55                                    char *device);
  • branches/2.2.9/mondo/src/common/libmondo-mountlist.c

    r2384 r2394  
    498498 * for each drive, and then spreads the flaws across three lines.
    499499 * @param mountlist The mountlist to evaluate.
    500  * @param flaws_str_A Where to put the first line listing errors found.
    501  * @param flaws_str_B Where to put the second line listing errors found.
    502  * @param flaws_str_C Where to put the third line listing errors found.
    503  * @return The number of flaws found (0 for success).
     500 * @return The flaws string (NULL for success).
    504501 * @see evaluate_drive_within_mountlist
    505502 */
    506 char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res) {
     503char *evaluate_mountlist(struct mountlist_itself *mountlist) {
    507504
    508505    /*@ buffer *********************************************************** */
     
    523520    /*@ initialize ******************************************************* */
    524521
    525     *res = 0;
    526522    drivelist = malloc(sizeof(struct list_of_disks));
    527523    assert(mountlist != NULL);
    528 
    529     mr_asprintf(&flaws_str, "%s", "");
    530524
    531525    make_list_of_drives_in_mountlist(mountlist, drivelist);
     
    543537            log_msg(8, "Evaluating drive #%d (%s) within mountlist", i, drivelist->el[i].device);
    544538            tmp = evaluate_drive_within_mountlist(mountlist, drivelist->el[i].device);
    545             if (tmp != NULL) {
    546                 (*res)++;
    547             }
    548539        }
    549540        log_msg(8,"Entry: %d (%s)", i, drivelist->el[i].device);
    550541        /* BCO: tmp can be NULL */
    551542        if (tmp != NULL) {
    552             log_msg(8,"Adding: %s to %s", tmp, flaws_str);
     543            log_msg(8,"Adding: %s to flaws_str", tmp);
    553544            mr_strcat(flaws_str, "%s", tmp);
    554545            paranoid_free(tmp);
     
    571562            mr_asprintf(&tmp, " %s %s's.", number_to_text(copies), curr_mountpoint);
    572563            mr_strcat(flaws_str, "%s", tmp);
    573             log_it(tmp);
     564            log_msg(8,"Adding: %s to flaws_str", tmp);
    574565            paranoid_free(tmp);
    575             (*res)++;
    576566        }
    577567        paranoid_free(curr_mountpoint);
  • branches/2.2.9/mondo/src/common/libmondo-mountlist.h

    r2384 r2394  
    44
    55
    6 char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res);
     6char *evaluate_mountlist(struct mountlist_itself *mountlist);
    77int find_device_in_mountlist(struct mountlist_itself *mountlist,
    88                             char *device);
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c

    r2380 r2394  
    19331933    /** int **************************************************************/
    19341934    int i = 0;
    1935     int res = 0;
    19361935    int currline = 0;
    19371936    int finished = FALSE;
     
    19751974                          bEdit, bDelete, bReload, bCancel, bOK, NULL);
    19761975    while (!finished) {
    1977         flaws_str = evaluate_mountlist(mountlist, &res);
     1976        flaws_str = evaluate_mountlist(mountlist);
    19781977        if (strlen(flaws_str) > 0) {
    19791978            mr_asprintf(&flaws_str_A, "%s", flaws_str + 1);
     
    20062005
    20072006        if (b_res == bOK) {
    2008             flaws_str = evaluate_mountlist(mountlist, &res);
    2009             mr_free(flaws_str);
    2010             if (!res) {
     2007            flaws_str = evaluate_mountlist(mountlist);
     2008            if (flaws_str != NULL) {
     2009                mr_free(flaws_str);
    20112010                finished =
    20122011                    ask_me_yes_or_no
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.h

    r2384 r2394  
    137137                   struct raidlist_itself *);
    138138void edit_raidrec_additional_vars(struct raid_device_record *);
    139 char *evaluate_mountlist(struct mountlist_itself *, int *);
     139char *evaluate_mountlist(struct mountlist_itself *);
    140140int find_device_in_mountlist(struct mountlist_itself *, char *);
    141141int find_next_free_index_in_disklist(struct list_of_disks *);
  • branches/2.2.9/mondo/src/mondorestore/mondorestore.c

    r2381 r2394  
    793793        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
    794794    }
    795     flaws_str = evaluate_mountlist(mountlist, &res);
    796     if (!res) {
     795    flaws_str = evaluate_mountlist(mountlist);
     796    if (flaws_str != NULL) {
    797797        sprintf(tmp,
    798798                "Mountlist analyzed. Result: \"%s\" Switch to Interactive Mode?",
     
    806806        }
    807807    }
    808     mr_free(flaws_str);
    809808
    810809    save_mountlist_to_disk(mountlist, g_mountlist_fname);
  • branches/2.2.9/mondo/src/mondorestore/mr-externs.h

    r2380 r2394  
    109109extern bool g_restoring_live_from_netfs;
    110110extern int fput_string_one_char_at_a_time(FILE *, char *);
    111 extern char *evaluate_mountlist(struct mountlist_itself *mountlist, int *res);
     111extern char *evaluate_mountlist(struct mountlist_itself *mountlist);
    112112
    113113
  • branches/2.2.9/mondo/test/test-mountlist.c

    r2350 r2394  
    5050struct mountlist_itself *mountlist = NULL;
    5151struct raidlist_itself *raidlist = NULL;
    52 int ret = 0;
    5352char *flaws_str = NULL;
    5453
     
    8079log_it("after edit_mountlist");
    8180
    82 flaws_str = evaluate_mountlist(mountlist, &ret);
     81flaws_str = evaluate_mountlist(mountlist);
    8382log_it("after evaluate_mountlist");
    8483mr_free(flaws_str);
Note: See TracChangeset for help on using the changeset viewer.