Ignore:
Timestamp:
Nov 5, 2016, 6:12:23 PM (7 years ago)
Author:
Bruno Cornec
Message:
  • Change interfaces for the call_program_and_get_last_line_of_output and where_is_root_mounted(now return dynamically allocated string)
  • removes useless function store_netfs_config
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c

    r3601 r3610  
    695695                strcpy(bkpinfo->prefix,STD_PREFIX);
    696696        }
    697         if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) {
     697        tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE);
     698        if (strstr(tmp1, "pxe")) {
    698699            /* We need to override prefix value in PXE mode as it's
    699700            * already done in start-netfs */
     
    704705            strcpy(bkpinfo->prefix,envtmp1);
    705706        }   
     707        mr_free(tmp1);
    706708    } else if (!strcmp(value, "tape")) {
    707709        bkpinfo->backup_media_type = tape;
     
    832834
    833835read_cfg_var(cfg_file, "please-dont-eject", value);
    834 if (value[0] || strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "donteject")) {
     836tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE);
     837if (value[0] || strstr(tmp1, "donteject")) {
    835838    bkpinfo->please_dont_eject = TRUE;
    836839    log_msg(2, "Ok, I shan't eject when restoring! Groovy.");
    837840}
     841mr_free(tmp1);
    838842
    839843/* TODO: Read here the boot_* variables */
     
    881885        }
    882886    }
    883     if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) {
     887    tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE);
     888    if (strstr(tmp1, "pxe")) {
    884889        /* We need to override values in PXE mode as it's
    885890        * already done in start-netfs */
     
    898903        mr_asprintf(bkpinfo->netfs_remote_dir, "%s", envtmp2);
    899904    }
     905    mr_free(tmp1);
    900906} else if (bkpinfo->backup_media_type == iso) {
    901907    /* Patch by Conor Daly 23-june-2004
     
    932938            mr_asprintf(command, "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3", g_isodir_device);
    933939            log_it("command = %s", command);
    934             log_it("res of it = %s", call_program_and_get_last_line_of_output(command));
    935             sprintf(iso_mnt, "%s", call_program_and_get_last_line_of_output(command));
     940            tmp1 = call_program_and_get_last_line_of_output(command);
     941            log_it("res of it = %s", tmp1);
     942            sprintf(iso_mnt, "%s", tmp1);
    936943            mr_free(command);
     944            mr_free(tmp1);
    937945        } else {
    938946            sprintf(iso_mnt, "/tmp/isodir");
     
    20642072    char *cfg_file = NULL;
    20652073    char *tmp = NULL;
     2074    char *tmp1 = NULL;
    20662075    char *mountpt = NULL;
    20672076    char *mountlist_file = NULL;
     
    21772186    if (does_file_exist(MONDO_CFG_FILE_STUB)) {
    21782187        log_msg(1, "gcffa --- great! We've got the config file");
    2179         mr_asprintf(tmp, "%s/%s", call_program_and_get_last_line_of_output("pwd"), MONDO_CFG_FILE_STUB);
     2188        tmp1 = call_program_and_get_last_line_of_output("pwd");
     2189        mr_asprintf(tmp, "%s/%s", tmp1, MONDO_CFG_FILE_STUB);
    21802190        mr_asprintf(command, "cp -f %s %s", tmp, cfg_file);
    21812191        log_it("%s",command);
     
    21892199        mr_free(command);
    21902200
    2191         mr_asprintf(command, "cp -f %s/%s %s", call_program_and_get_last_line_of_output("pwd"), MOUNTLIST_FNAME_STUB, mountlist_file);
     2201        mr_asprintf(command, "cp -f %s/%s %s", tmp1, MOUNTLIST_FNAME_STUB, mountlist_file);
     2202        mr_free(tmp1);
    21922203        log_it("%s",command);
    21932204        if (extract_mountlist_stub) {
Note: See TracChangeset for help on using the changeset viewer.