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/mondorestore.c

    r3564 r3610  
    18761876    log_it("Done loading config file; resizing ML");
    18771877
    1878     mr_asprintf(tmp1, "%s", call_program_and_get_last_line_of_output("cat "CMDLINE));
     1878    tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE);
    18791879    if (strstr(tmp1, "noresize")) {
    18801880        log_msg(1, "Not resizing mountlist.");
     
    21022102    get_cfg_file_from_archive_or_bust();
    21032103    load_mountlist(mountlist, g_mountlist_fname);   // in case read_cfg_file_into_bkpinfo updated the mountlist
    2104 #ifdef __FreeBSD__
    2105     if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "noresize"))
    2106 #else
    2107     if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "noresize"))
    2108 #endif
    2109     {
     2104    tmp = call_program_and_get_last_line_of_output("cat "CMDLINE);
     2105    if (strstr(tmp, "noresize")) {
    21102106        log_msg(2, "Not resizing mountlist.");
    21112107    } else {
    21122108        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
    21132109    }
     2110    mr_free(tmp);
     2111
    21142112    flaws_str = evaluate_mountlist(mountlist);
    21152113    if (flaws_str != NULL) {
     
    21382136            twenty_seconds_til_yikes();
    21392137            g_fprep = fopen("/tmp/prep.sh", "w");
    2140             mr_asprintf(tmp1, "%s", call_program_and_get_last_line_of_output("cat "CMDLINE));
     2138            tmp1 = call_program_and_get_last_line_of_output("cat "CMDLINE);
    21412139            if (strstr(tmp1, "nopart")) {
    21422140                log_msg(2, "Not partitioning drives due to 'nopart' option.");
     
    22042202
    22052203  after_the_nuke:
    2206     mr_asprintf(tmp1, "%s", call_program_and_get_last_line_of_output("cat "CMDLINE));
     2204    tmp1 =call_program_and_get_last_line_of_output("cat "CMDLINE);
    22072205    if (retval) {
    22082206        log_to_screen("Errors occurred during the nuke phase.");
     
    25952593
    25962594/* Configure global variables */
    2597 #ifdef __FreeBSD__
    2598     if (strstr
    2599         (call_program_and_get_last_line_of_output("cat /tmp/cmdline"),
    2600          "textonly"))
    2601 #else
    2602     if (strstr
    2603         (call_program_and_get_last_line_of_output("cat /proc/cmdline"),
    2604          "textonly"))
    2605 #endif
    2606     {
     2595    tmp = call_program_and_get_last_line_of_output("cat "CMDLINE);
     2596    if (strstr(tmp, "textonly")) {
    26072597        g_text_mode = TRUE;
    26082598        log_msg(1, "TEXTONLY MODE");
     
    26102600        g_text_mode = FALSE;
    26112601    }                           // newt :-)
     2602    mr_free(tmp);
     2603
    26122604    if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
    26132605        fatal_error("Cannot malloc mountlist");
     
    26222614    malloc_libmondo_global_strings();
    26232615
    2624     strcpy(g_mondo_home,
    2625            call_program_and_get_last_line_of_output("which mondorestore"));
     2616    tmp = call_program_and_get_last_line_of_output("which mondorestore");
     2617    strcpy(g_mondo_home, tmp);
     2618        mr_free(tmp);
     2619
    26262620    g_current_media_number = 1; // precaution
    2627 
    26282621    run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE);
    26292622
Note: See TracChangeset for help on using the changeset viewer.