Ignore:
Timestamp:
Aug 18, 2009, 3:19:15 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3336@localhost: bruno | 2009-08-11 16:32:36 +0200

  • bkpinfo->media_device, bkpinfo->nfs_remote_dir, and bkpinfo->nfs_mount are now dynamically allocated
  • new interfaces for find_cdrom_device(), find_tape_device_and_size(), find_dvd_device(), find_cdrw_device(), set_dev_to_this_if_rx_OK() and read_cfg_var() which allocate the string now returned
  • Better differentiation between ISO and NFS iso file names construction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2324 r2325  
    969969        interactively_obtain_media_parameters_from_user(FALSE);
    970970    }
    971     log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
    972     if (!bkpinfo->media_device[0]) {
    973         log_msg(2, "Warning - failed to find media dev");
     971    if (!bkpinfo->media_device) {
     972        log_msg(2, "WARNING: failed to find media dev");
     973    } else {
     974        log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
    974975    }
    975976
     
    19992000    long noof_biggiefiles, bigfileno = 0, total_slices;
    20002001  /** malloc **/
    2001     char *tmp;
    20022002    char *tmp1 = NULL;
    20032003    char *mds = NULL;
     
    20092009    FILE *fbw = NULL;
    20102010
    2011     malloc_string(tmp);
    20122011    malloc_string(pathname_of_last_biggie_restored);
    20132012    assert(bkpinfo != NULL);
     
    20182017    }
    20192018
    2020     read_cfg_var(g_mondo_cfg_file, "total-slices", tmp);
    2021     total_slices = atol(tmp);
     2019    tmp1 = read_cfg_var(g_mondo_cfg_file, "total-slices");
     2020    total_slices = atol(tmp1);
     2021    mr_free(tmp1);
     2022
    20222023    mr_asprintf(tmp1, "Reassembling large files      ");
    20232024    mvaddstr_and_log_it(g_currentY, 0, tmp1);
     
    21082109        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    21092110    }
    2110     paranoid_free(tmp);
    21112111    paranoid_free(pathname_of_last_biggie_restored);
    21122112    return (retval);
     
    21382138    long max_val;
    21392139  /**malloc ***/
    2140     char *tmp = NULL;
    21412140    char *mds = NULL;
    21422141    char *tmp1 = NULL;
     
    21452144    char *comment;
    21462145
    2147     malloc_string(tmp);
    21482146    malloc_string(comment);
    21492147
     
    21572155    }
    21582156    insist_on_this_cd_number(g_current_media_number);
    2159     read_cfg_var(g_mondo_cfg_file, "last-filelist-number", tmp);
    2160     max_val = atol(tmp) + 1;
    2161     paranoid_free(tmp);
     2157    tmp1 = read_cfg_var(g_mondo_cfg_file, "last-filelist-number");
     2158    max_val = atol(tmp1) + 1;
     2159    mr_free(tmp1);
    21622160
    21632161    mds = media_descriptor_string(bkpinfo->backup_media_type);
     
    22782276
    22792277  /** malloc add ****/
    2280     char *tmp;
    2281     char *tmp1;
     2278    char *tmp1 = NULL;
    22822279    char *biggie_fname;
    22832280    char *biggie_cksum;
     
    22902287    FILE *fbw = NULL;
    22912288
    2292     malloc_string(tmp);
    22932289    malloc_string(biggie_fname);
    22942290    malloc_string(biggie_cksum);
     
    22962292    assert(bkpinfo != NULL);
    22972293
    2298     read_cfg_var(g_mondo_cfg_file, "total-slices", tmp);
    2299 
    2300     total_slices = atol(tmp);
     2294    tmp1 = read_cfg_var(g_mondo_cfg_file, "total-slices");
     2295    total_slices = atol(tmp1);
     2296    mr_free(tmp1);
     2297
    23012298    if (g_getfattr) {
    23022299        mr_asprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     
    24082405    paranoid_free(biggie_fname);
    24092406    paranoid_free(biggie_cksum);
    2410     paranoid_free(tmp);
    24112407    return (retval);
    24122408}
     
    24532449    assert(bkpinfo != NULL);
    24542450    mvaddstr_and_log_it(g_currentY, 0, "Restoring from archives");
    2455     read_cfg_var(g_mondo_cfg_file, "last-filelist-number", tmp);
     2451    tmp = read_cfg_var(g_mondo_cfg_file, "last-filelist-number");
    24562452    max_val = atol(tmp) + 1;
     2453    mr_free(tmp);
    24572454
    24582455    chdir(bkpinfo->restore_path);   /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */
     
    25952592            openin_cdstream();
    25962593        } else {
    2597             assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device);
    25982594            openin_tape();
    25992595        }
     
    29332929        // BCO:To be reviewed
    29342930        if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) {
    2935             if (bkpinfo->backup_media_type == nfs
    2936                 && !is_this_device_mounted(bkpinfo->nfs_mount)) {
     2931            if (bkpinfo->backup_media_type == nfs && bkpinfo->nfs_mount && !is_this_device_mounted(bkpinfo->nfs_mount)) {
    29372932                log_msg(1, "Mounting nfs dir");
    29382933                mr_free(bkpinfo->isodir);
Note: See TracChangeset for help on using the changeset viewer.