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

r3340@localhost: bruno | 2009-08-12 00:17:29 +0200
Improve portability by defining all cmdline usage in 1 include (/tmp for FreeBSD and /proc fior LInux). Also doing tht for scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2327 r2329  
    471471    log_it("Done loading config file; resizing ML");
    472472
    473 #ifdef __FreeBSD__
    474     if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "noresize"))
    475 #else
    476     if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "noresize"))
    477 #endif
    478     {
     473    if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "noresize")) {
    479474        log_msg(1, "Not resizing mountlist.");
    480475    } else {
     
    773768    get_cfg_file_from_archive_or_bust();
    774769    load_mountlist(mountlist, g_mountlist_fname);   // in case read_cfg_file_into_bkpinfo updated the mountlist
    775 #ifdef __FreeBSD__
    776     if (strstr
    777         (call_program_and_get_last_line_of_output("cat /tmp/cmdline"),
    778          "noresize"))
    779 #else
    780     if (strstr
    781         (call_program_and_get_last_line_of_output("cat /proc/cmdline"),
    782          "noresize"))
    783 #endif
    784     {
     770    if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "noresize")) {
    785771        log_msg(2, "Not resizing mountlist.");
    786772    } else {
     
    811797            twenty_seconds_til_yikes();
    812798            g_fprep = fopen("/tmp/prep.sh", "w");
    813 #ifdef __FreeBSD__
    814             if (strstr
    815                 (call_program_and_get_last_line_of_output
    816                  ("cat /tmp/cmdline"), "nopart"))
    817 #else
    818             if (strstr
    819                 (call_program_and_get_last_line_of_output
    820                  ("cat /proc/cmdline"), "nopart"))
    821 #endif
    822             {
     799            if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "nopart")) {
    823800                log_msg(2,
    824801                        "Not partitioning drives due to 'nopart' option.");
     
    894871    if (retval) {
    895872        log_to_screen("Errors occurred during the nuke phase.");
    896     } else if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "RESTORE")) {
     873    } else if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "RESTORE")) {
    897874        log_to_screen
    898875            ("PC was restored successfully. Thank you for using Mondo Rescue.");
     
    26672644    /* Configure global variables */
    26682645    malloc_libmondo_global_strings();
    2669 #ifdef __FreeBSD__
    2670     if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "textonly"))
    2671 #else
    2672     if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "textonly"))
    2673 #endif
     2646    if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "textonly"))
    26742647    {
    26752648        g_text_mode = TRUE;
Note: See TracChangeset for help on using the changeset viewer.