Changeset 900 in MondoRescue for trunk/mondo/src/mondoarchive/main.c


Ignore:
Timestamp:
Oct 24, 2006, 8:49:18 AM (18 years ago)
Author:
Bruno Cornec
Message:

Huge patch to introduce low level functions that will bw used everywhere (mr_free, mr_asprintf, ...)
Nearly linking now due to that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/mondoarchive/main.c

    r815 r900  
    2121#include "../common/libmondo.h"
    2222#include "mondo-cli-EXT.h"
     23
     24#include "mr_mem.h"
    2325
    2426// for CVS
     
    185187
    186188    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
    187     asprintf(&tmp, "/sbin:/usr/sbin:%s:/usr/local/sbin", getenv("PATH"));
     189    mr_asprintf(&tmp, "/sbin:/usr/sbin:%s:/usr/local/sbin", getenv("PATH"));
    188190    setenv("PATH", tmp, 1);
    189     paranoid_free(tmp);
     191    mr_free(tmp);
    190192
    191193    /* Add the ARCH environment variable for ia64 purposes */
     
    236238        turn_wildcard_chars_into_literal_chars(tmp, argv[2]);
    237239        printf("in=%s; out=%s\n", argv[2], tmp);
    238         paranoid_free(tmp);
     240        mr_free(tmp);
    239241        finish(1);
    240242    }
     
    268270            printf(_("CD-RW is at %s\n"), tmp);
    269271        }
    270         paranoid_free(tmp);
     272        mr_free(tmp);
    271273
    272274        if ((tmp = find_cdrom_device(FALSE)) == NULL) {
     
    275277            printf(_("CD-ROM is at %s\n"), tmp);
    276278        }
    277         paranoid_free(tmp);
     279        mr_free(tmp);
    278280        finish(0);
    279281    }
     
    288290            printf(_("DVD is at %s\n"), tmp);
    289291        }
    290         paranoid_free(tmp);
     292        mr_free(tmp);
    291293        finish(0);
    292294    }
     
    345347        retval += res;
    346348        if (res) {
    347             asprintf(&say_at_end,
     349            mr_asprintf(&say_at_end,
    348350                   _("Data archived. Please check the logs, just as a precaution. "));
    349351        } else {
    350             asprintf(&say_at_end, _("Data archived OK. "));
     352            mr_asprintf(&say_at_end, _("Data archived OK. "));
    351353        }
    352354    }
     
    356358        res = verify_data(bkpinfo);
    357359        if (res < 0) {
    358             asprintf(&say_at_end, _("%d difference%c found."), -res,
     360            mr_asprintf(&say_at_end, _("%d difference%c found."), -res,
    359361                    (-res != 1) ? 's' : ' ');
    360362            res = 0;
     
    399401    }
    400402    log_to_screen(say_at_end);
    401     paranoid_free(say_at_end);
    402 
    403     asprintf(&tmp, "umount %s/tmpfs", bkpinfo->tmpdir);
     403    mr_free(say_at_end);
     404
     405    mr_asprintf(&tmp, "umount %s/tmpfs", bkpinfo->tmpdir);
    404406    run_program_and_log_output(tmp, TRUE);
    405     paranoid_free(tmp);
    406 
    407     asprintf(&g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir,
     407    mr_free(tmp);
     408
     409    mr_asprintf(&g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir,
    408410            bkpinfo->scratchdir);
    409411    run_program_and_log_output(g_erase_tmpdir_and_scratchdir, TRUE);
     
    424426    system(g_erase_tmpdir_and_scratchdir);
    425427    free_libmondo_global_strings();
    426     paranoid_free(bkpinfo);
     428    mr_free((void *)bkpinfo);
    427429
    428430    unlink("/tmp/filelist.full");
Note: See TracChangeset for help on using the changeset viewer.