Changeset 1161 in MondoRescue for trunk/mondo/src/common/libmondo-files.c


Ignore:
Timestamp:
Feb 14, 2007, 1:13:49 PM (17 years ago)
Author:
Bruno Cornec
Message:

Update trunk with the latest feedback from stable (obtained with meld) - First pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/common/libmondo-files.c

    r1106 r1161  
    4545    /*@ buffers ***************************************************** */
    4646    static char *output = NULL;
    47     char *command;
    48     char *tmp;
     47
     48    char *command = NULL;
     49    char *tmp = NULL;
    4950    size_t n = 0;
    5051
     
    9495
    9596    /*@ buffers ***************************************************** */
    96     char *command;
     97    char *command = NULL;
    9798    char *incoming = NULL;
    98     char *tmp;
     99    char *tmp = NULL;
    99100
    100101    /*@ long ******************************************************** */
     
    207208    if (!(fout = fopen(outfname, "w"))) {
    208209        log_OS_error("Unable to openout outfname");
     210        mr_free(infname);
    209211        mr_free(outfname);
    210212        return;
     
    600602void register_pid(pid_t pid, char *name_str)
    601603{
    602     char *tmp;
    603     char *lockfile_fname;
     604    char *tmp = NULL;
     605    char *lockfile_fname = NULL;
    604606    int res;
    605607    size_t n = 0;
     
    754756}
    755757
    756 
    757758/**
    758759 * Determine the amount of space (in KB) occupied by a mounted CD.
     
    942943{
    943944    /*@ Char buffers ** */
    944     char *command;
     945    char *command = NULL;
    945946    char *tmp;
    946947    char old_pwd[MAX_STR_LEN];
     
    964965    mr_free(command);
    965966
    966     mr_asprintf(&tmp, "%s/payload.tgz", g_mondo_home);
    967 
    968967    /* i18n */
    969968    mr_asprintf(&command, CP_BIN " --parents /usr/share/locale/*/LC_MESSAGES/mondo.mo %s",bkpinfo->scratchdir);
     
    972971    mr_free(command);
    973972
     973    mr_asprintf(&tmp, "%s/payload.tgz", g_mondo_home);
    974974    if (does_file_exist(tmp)) {
    975975        log_it("Untarring payload %s to scratchdir %s", tmp,
     
    11141114                "ifconfig %s | awk '{print $5}' | head -n1", nfs_dev);
    11151115        mac_addr = call_program_and_get_last_line_of_output(command);
     1116        mr_free(command);
     1117
    11161118        mr_asprintf(&command,
    1117                 "ifconfig | grep -E '%s' | grep -v '%s' | head -n1  | cut -d' ' -f1", mac_addr);
     1119                "ifconfig | grep -E '%s' | grep -v '%s' | head -n1  | cut -d' ' -f1", mac_addr, nfs_dev);
    11181120        mr_free(nfs_dev);
    11191121        nfs_dev = call_program_and_get_last_line_of_output(command);
     
    11251127
    11261128    mr_free(nfs_dev);
    1127     mr_free(tmp);
    1128 
    11291129    fd1 = mr_fopen(MONDORESTORECFG, "a");
    11301130    mr_fprintf(fd1, "nfs-dev %s\n", nfs_dev);
     
    12661266int make_grub_install_scriptlet(char *outfile)
    12671267{
    1268     FILE *fout;
    1269     char *tmp;
     1268    FILE *fout = NULL;
     1269    char *tmp = NULL;
    12701270    int retval = 0;
    12711271
Note: See TracChangeset for help on using the changeset viewer.