Ignore:
Timestamp:
Mar 12, 2024, 3:10:24 AM (2 months ago)
Author:
Bruno Cornec
Message:

More compiler fixes

  • Fix unused vars
  • Fix FreeBSD #if alone
  • Use MDSTAT_FILE everywhere
  • Fix missing break
  • Fix some strncpy. mr_strncpy used when safe
  • Fix wrong g_isoform_header_str proto !
  • find-cd & find-dvd => find-optical
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3889 r3892  
    443443                mr_free(mount_list);
    444444
    445                 mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
     445                mr_asprintf(command, "%s", "cat " MDSTAT_FILE " |grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    446446                log_msg (5, "Running: %s", command);
    447447                mount_list = call_program_and_get_last_line_of_output(command);
     
    499499
    500500        /* Get the Software raid device list */
    501         mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
     501        mr_asprintf(command, "%s", "cat " MDSTAT_FILE " | grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    502502        log_msg (5, "  Running: %s", command);
    503503        mount_list = call_program_and_get_last_line_of_output(command);
     
    788788bool does_nonMS_partition_exist(void)
    789789{
    790 #if __FreeBSD__
     790#ifdef __FreeBSD__
    791791    return
    792792        !system("for drive in /dev/ad? /dev/da?; do fdisk $drive | grep -q FreeBSD && exit 0; done; false");
     
    21362136
    21372137    case udev:
    2138         if (!ask_me_yes_or_no
    2139             ("This option is for advanced users only. Are you sure?")) {
     2138        if (!ask_me_yes_or_no("This option is for advanced users only. Are you sure?")) {
    21402139            log_to_screen("User has chosen not to backup the machine");
    21412140            finish(1);
    21422141        }
     2142        break;
     2143
    21432144    case tape:
    21442145
     
    24832484// NTFS
    24842485        tmp = call_program_and_get_last_line_of_output("mr-parted2fdisk -l 2>/dev/null | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'");
    2485         strncpy(tmp1, tmp,(MAX_STR_LEN / 4)-1);
     2486        if (strlen(tmp) > 2) {
     2487            tmp1 = mr_popup_and_get_string("NTFS partitions", "Please enter/confirm the NTFS partitions you wish to backup as well.", tmp);
     2488            if (tmp1 == NULL) {
     2489                log_to_screen("User has chosen not to backup the machine");
     2490                mr_free(tmp);
     2491                mr_free(tmp1);
     2492                finish(1);
     2493            }
     2494            mr_free(bkpinfo->image_devs);
     2495            bkpinfo->image_devs = tmp1;
     2496        }
    24862497        mr_free(tmp);
    2487         if (strlen(tmp1) > 2) {
    2488             if (!popup_and_get_string("NTFS partitions", "Please enter/confirm the NTFS partitions you wish to backup as well.", tmp1,(MAX_STR_LEN / 4)-1)) {
    2489                 log_to_screen("User has chosen not to backup the machine");
    2490                 finish(1);
    2491             }
    2492             mr_asprintf(bkpinfo->image_devs, "%s", tmp1);
    2493         }
    24942498
    24952499        if (bkpinfo->exclude_paths != NULL ) {
     
    25722576        mr_free(compression_type);
    25732577
     2578#ifdef __FreeBSD__
    25742579#if __FreeBSD__ == 5
    25752580        mr_asprintf(bkpinfo->kernel_path, "%s", "/boot/kernel/kernel");
    25762581#elif __FreeBSD__ == 4
    25772582        mr_asprintf(bkpinfo->kernel_path, "%s", "/kernel");
     2583#endif
    25782584#elif linux
    25792585        if (figure_out_kernel_path_interactively_if_necessary(bkpinfo->kernel_path)) {
Note: See TracChangeset for help on using the changeset viewer.