Ignore:
Timestamp:
Sep 20, 2013, 2:29:57 PM (11 years ago)
Author:
Bruno Cornec
Message:

Simplify the interface of mr_getline and mr_asprintf. With 3.1 compatibility now will allow backports from this branch into 3.0

File:
1 edited

Legend:

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

    r3158 r3185  
    354354
    355355    /* Clean up blkid cache file if they exist */
    356     mr_asprintf(&tmp1,"%s/etc/blkid.tab",bkpinfo->restore_path);
     356    mr_asprintf(tmp1,"%s/etc/blkid.tab",bkpinfo->restore_path);
    357357    (void)unlink(tmp1);
    358358    paranoid_free(tmp1);
    359     mr_asprintf(&tmp1,"%s/etc/blkid.tab.old",bkpinfo->restore_path);
     359    mr_asprintf(tmp1,"%s/etc/blkid.tab.old",bkpinfo->restore_path);
    360360    (void)unlink(tmp1);
    361361    paranoid_free(tmp1);
     
    369369
    370370    /* Clean up multiconf cache file if they exist */
    371     mr_asprintf(&tmp1,"%s/var/lib/multipath/bindings",bkpinfo->restore_path);
     371    mr_asprintf(tmp1,"%s/var/lib/multipath/bindings",bkpinfo->restore_path);
    372372    (void)unlink(tmp1);
    373373    paranoid_free(tmp1);
    374374
    375375    /* Edit multipath.conf if needed to adapt wwid */
    376     mr_asprintf(&tmp1,"%s/etc/multipath.conf", MNT_RESTORING);
     376    mr_asprintf(tmp1,"%s/etc/multipath.conf", MNT_RESTORING);
    377377    if (does_file_exist(tmp1)) {
    378378        log_msg(2, "We may need to clean /etc/multipath.conf");
     
    384384
    385385    if (bkpinfo->restore_mode != nuke) {
    386         mr_asprintf(&editor, "%s", find_my_editor());
    387         mr_asprintf(&tmp1,"chroot %s %s /etc/multipath.conf", MNT_RESTORING, editor);
     386        mr_asprintf(editor, "%s", find_my_editor());
     387        mr_asprintf(tmp1,"chroot %s %s /etc/multipath.conf", MNT_RESTORING, editor);
    388388        popup_and_OK("You will now edit multipath.conf");
    389389        if (!g_text_mode) {
     
    16701670    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
    16711671//  sprintf(files_to_restore_this_time_fname, "/tmp/ftrttf.%d.%d", (int)getpid(), (int)random());
    1672     mr_asprintf(&command, "mkdir -p %s/tmp", MNT_RESTORING);
     1672    mr_asprintf(command, "mkdir -p %s/tmp", MNT_RESTORING);
    16731673    run_program_and_log_output(command, 9);
    16741674    paranoid_free(command);
     
    17571757//      if (strstr(tarball_fname, ".star."))
    17581758        if (use_star) {
    1759             mr_asprintf(&command, "star -x -force-remove -sparse -U " STAR_ACL_SZ " file=%s", tarball_fname);
     1759            mr_asprintf(command, "star -x -force-remove -sparse -U " STAR_ACL_SZ " file=%s", tarball_fname);
    17601760            if (strstr(tarball_fname, ".bz2")) {
    17611761                mr_strcat(command, " -bz");
     
    17631763        } else {
    17641764            if (filelist_subset_fname[0] != '\0') {
    1765                 mr_asprintf(&command, "afio -i -M 8m -b %ld -c %ld %s -w '%s' %s", TAPE_BLOCK_SIZE, BUFSIZE, executable, filelist_subset_fname, tarball_fname);
     1765                mr_asprintf(command, "afio -i -M 8m -b %ld -c %ld %s -w '%s' %s", TAPE_BLOCK_SIZE, BUFSIZE, executable, filelist_subset_fname, tarball_fname);
    17661766            } else {
    1767                 mr_asprintf(&command, "afio -i -b %ld -c %ld -M 8m %s %s", TAPE_BLOCK_SIZE, BUFSIZE, executable, tarball_fname);
     1767                mr_asprintf(command, "afio -i -b %ld -c %ld -M 8m %s %s", TAPE_BLOCK_SIZE, BUFSIZE, executable, tarball_fname);
    17681768            }
    17691769        }
     
    18181818        // Be verbose for star
    18191819        if (retval || use_star) {
    1820             mr_asprintf(&command, "cat %s >> %s", temp_log, MONDO_LOGFILE);
     1820            mr_asprintf(command, "cat %s >> %s", temp_log, MONDO_LOGFILE);
    18211821            paranoid_system(command);
    18221822            paranoid_free(command);
     
    23102310                                              filelist);
    23112311            }
    2312             mr_asprintf(&tmp1, "%s #%d, fileset #%ld - restore ",
     2312            mr_asprintf(tmp1, "%s #%d, fileset #%ld - restore ",
    23132313                    mds, g_current_media_number, current_tarball_number);
    23142314            if (res) {
Note: See TracChangeset for help on using the changeset viewer.