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-prep.c

    r3570 r3610  
    154154char *tmp;
    155155char *tmp1 = NULL;
     156char *tmp2 = NULL;
    156157char *incoming;
    157158char *command;
     
    186187#endif
    187188
    188 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "nolvm")) {
     189tmp = call_program_and_get_last_line_of_output("cat "CMDLINE);
     190if (strstr(tmp, "nolvm")) {
     191    mr_free(tmp);
    189192    return(0);
    190193}
     194mr_free(tmp);
     195
    191196if (!(fin = fopen("/tmp/i-want-my-lvm", "r"))) {
    192197    log_OS_error("/tmp/i-want-my-lvm");
     
    299304            if (lvmversion == 2) {
    300305                mr_asprintf(tmp1, "tail -n5 %s | grep Insufficient | tail -n1", MONDO_LOGFILE);
    301                 strcpy(tmp, call_program_and_get_last_line_of_output(tmp1));
    302                 free(tmp1);
    303306            } else {
    304307                mr_asprintf(tmp1, "tail -n5 %s | grep lvcreate | tail -n1", MONDO_LOGFILE);
    305                 strcpy(tmp, call_program_and_get_last_line_of_output(tmp1));
    306                 free(tmp1);
    307308            }
     309            tmp2 =  call_program_and_get_last_line_of_output(tmp1);
     310            strcpy(tmp, tmp2);
     311            mr_free(tmp2);
     312            mr_free(tmp1);
     313
    308314            for (p = tmp; *p != '\0' && !isdigit(*p); p++);
    309315            extents = atol(p);
     
    14821488    // mark relevant partition as bootable
    14831489    mr_asprintf(tmp1,"mr-make-me-bootable /tmp/mountlist.txt %s",drivename);
    1484     call_program_and_get_last_line_of_output(tmp1);
     1490    tmp = call_program_and_get_last_line_of_output(tmp1);
    14851491    mr_free(tmp1);
     1492    mr_free(tmp);
    14861493
    14871494    log_msg(0,"------------------- end of fdisk.log...       ------------------");
Note: See TracChangeset for help on using the changeset viewer.