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

r3335@localhost: bruno | 2009-08-08 23:04:12 +0200

  • Change mr_asprintf to avoid the need of pointer and be consistent with the other mr_mem functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2323 r2324  
    828828    bkpinfo->disaster_recovery = (am_I_in_disaster_recovery_mode()? TRUE : FALSE);
    829829    if (bkpinfo->disaster_recovery) {
    830         mr_asprintf(p, "%s", "/");
     830        mr_asprintf(bkpinfo->isodir, "%s", "/");
    831831    } else {
    832         mr_asprintf(p, "%s", MONDO_CACHE);
    833     }
    834     bkpinfo->isodir = p;
    835     mr_asprintf(p, "%s", STD_PREFIX);
    836     bkpinfo->prefix = p;
    837     bkpinfo->scratchdir = NULL;
    838     bkpinfo->tmpdir = NULL;
     832        mr_asprintf(bkpinfo->isodir, "%s", MONDO_CACHE);
     833    }
     834    mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX);
     835    bkpinfo->scratchdir = NULL;     // Really setup after
     836    bkpinfo->tmpdir = NULL;         // Really setup after
    839837    bkpinfo->optimal_set_size = 0;
    840838    bkpinfo->backup_media_type = none;
     
    889887    mr_free(command);
    890888
    891     mr_asprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4",
    892             partition);
     889    mr_asprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4", partition);
    893890    mr_asprintf(out_sz, "%s", call_program_and_get_last_line_of_output(command));
    894891    mr_free(command);
     
    941938    }
    942939    if (atol(tmp) < 66000) {
    943         log_to_screen
    944             ("WARNING! You have very little RAM. Please upgrade to 64MB or more.");
     940        log_to_screen("WARNING! You have very little RAM. Please upgrade to 64MB or more.");
    945941    }
    946942    mr_free(tmp);
     
    10801076    /*@ buffer ****************************************************** */
    10811077    char *command = NULL;
    1082     char *tmp = NULL;
    10831078
    10841079    /*@ end vars *************************************************** */
     
    10871082    assert_string_is_neither_NULL_nor_zerolength(label);
    10881083    if (!does_file_exist(config_file)) {
    1089         mr_asprintf(tmp, "(read_cfg_var) Cannot find %s config file", config_file);
    1090         log_to_screen(tmp);
    1091         mr_free(tmp);
    1092 
     1084        log_to_screen("(read_cfg_var) Cannot find %s config file", config_file);
    10931085        value[0] = '\0';
    10941086        return (1);
     
    12521244                    strcpy(g_boot_mountpt, tmp);
    12531245                    mr_free(tmp);
    1254                     mr_asprintf(tmp, "%s (your /boot partition) is not mounted. I'll mount it before backing up", g_boot_mountpt);
    1255                     log_it(tmp);
    1256                     mr_free(tmp);
     1246                    log_it("%s (your /boot partition) is not mounted. I'll mount it before backing up", g_boot_mountpt);
    12571247
    12581248                    mr_asprintf(tmp, "mount %s", g_boot_mountpt);
     
    13111301    char *command = NULL;
    13121302    char *tempfile = NULL;
    1313     char *tmp = NULL;
    13141303
    13151304
     
    13191308    assert(value != NULL);
    13201309    if (!does_file_exist(config_file)) {
    1321         mr_asprintf(tmp, "(write_cfg_file) Cannot find %s config file", config_file);
    1322         log_to_screen(tmp);
    1323         mr_free(tmp);
     1310        log_to_screen("(write_cfg_file) Cannot find %s config file", config_file);
    13241311        return (1);
    13251312    }
Note: See TracChangeset for help on using the changeset viewer.