Ignore:
Timestamp:
May 13, 2009, 4:34:00 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • Remove useless function look_for_weird_formats
  • Adds a test program for mountlist management to find a seg. fault bug when using a large mountlist file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-archive.c

    r2190 r2202  
    803803    }
    804804    if (bkpinfo->backup_media_type == usb) {
    805         asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
     805        (void)asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
    806806    } else {
    807         asprintf(&tmp2," ");
     807        (void)asprintf(&tmp2," ");
    808808    }
    809809
     
    828828
    829829    if (g_getfattr) {
    830         asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);
     830        (void)asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);
    831831        if (write_one_liner_data_file(tmp1, "TRUE")) {
    832832            log_msg(1, "%ld: Unable to write one-liner XATTR",
     
    836836    }
    837837    if (g_getfacl) {
    838         asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);
     838        (void)asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);
    839839        if (write_one_liner_data_file(tmp1, "TRUE")) {
    840840            log_msg(1, "%ld: Unable to write one-liner ACL",
     
    844844    }
    845845    if (bkpinfo->use_obdr) {
    846         asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir);
     846        (void)asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir);
    847847        if (write_one_liner_data_file(tmp1, "TRUE")) {
    848848            log_msg(1, "%ld: Unable to write one-liner OBDR",
     
    15811581    log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir);
    15821582    (void) getcwd(old_pwd, MAX_STR_LEN - 1);
    1583     asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir);
     1583    (void)asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir);
    15841584    run_program_and_log_output(tmp, FALSE);
    15851585    paranoid_free(tmp);
    1586     chdir(bkpinfo->scratchdir);
    1587 
    1588     asprintf(&message_to_screen, "Copying data to make %s #%d",
     1586    (void)chdir(bkpinfo->scratchdir);
     1587
     1588    (void)asprintf(&message_to_screen, "Copying data to make %s #%d",
    15891589                media_descriptor_string(bkpinfo->backup_media_type),
    15901590                g_current_media_number);
    15911591    log_msg(1, message_to_screen);
    15921592
    1593     asprintf(&tmp1, "%s1", bkpinfo->media_device);
     1593    (void)asprintf(&tmp1, "%s1", bkpinfo->media_device);
    15941594    if (is_this_device_mounted(tmp1)) {
    15951595        log_msg(1, "USB device mounted. Remounting it at the right place");
    1596         asprintf(&tmp, "umount %s", tmp1);
     1596        (void)asprintf(&tmp, "umount %s", tmp1);
    15971597        run_program_and_log_output(tmp, FALSE);
    15981598        paranoid_free(tmp);
     
    16011601
    16021602    log_msg(1, "Mounting USB device.");
    1603     asprintf(&tmp1, "%s/usb", bkpinfo->tmpdir);
    1604     asprintf(&tmp, "mkdir -p %s", tmp1);
     1603    (void)asprintf(&tmp1, "%s/usb", bkpinfo->tmpdir);
     1604    (void)asprintf(&tmp, "mkdir -p %s", tmp1);
    16051605    run_program_and_log_output(tmp, FALSE);
    16061606    paranoid_free(tmp);
    16071607    /* Mindi always create one single parition on the USB dev */
    1608     asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, tmp1);
     1608    (void)asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, tmp1);
    16091609    run_program_and_log_output(tmp, FALSE);
    16101610    paranoid_free(tmp);
     
    16161616
    16171617        /* Command to execute */
    1618         asprintf(&tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1);
     1618        (void)asprintf(&tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1);
    16191619        res = eval_call_to_make_USB(tmp, message_to_screen);
    16201620        if (res) {
    1621             asprintf(&result_sz, "%s ...failed",tmp);
     1621            (void)asprintf(&result_sz, "%s ...failed",tmp);
    16221622        } else {
    1623             asprintf(&result_sz, "%s ...OK",tmp);
     1623            (void)asprintf(&result_sz, "%s ...OK",tmp);
    16241624        }
    16251625        log_to_screen(result_sz);
     
    16321632
    16331633    if (is_this_device_mounted(bkpinfo->media_device)) {
    1634         asprintf(&tmp, "umount %s1", bkpinfo->media_device);
     1634        (void)asprintf(&tmp, "umount %s1", bkpinfo->media_device);
    16351635        run_program_and_log_output(tmp, FALSE);
    16361636        paranoid_free(tmp);
    16371637    }
    16381638
    1639     chdir(old_pwd);
     1639    (void)chdir(old_pwd);
    16401640    if (retval) {
    16411641        log_msg(1, "WARNING - make_usb_fs returned an error");
     
    17691769                    ("Failed to write to disk. I shall blank it and then try again.");
    17701770                sleep(5);
    1771                 system("sync");
     1771                (void)system("sync");
    17721772                pause_for_N_seconds(5, "Letting DVD drive settle");
    17731773
     
    23982398    }
    23992399
    2400     asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,
     2400    (void)asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,
    24012401            biggielist);
    24022402    paranoid_system(command);
    24032403    paranoid_free(command);
    24042404
    2405     asprintf(&blah, "biggielist = %s", biggielist);
     2405    (void)asprintf(&blah, "biggielist = %s", biggielist);
    24062406    log_msg(2, blah);
    24072407    paranoid_free(blah);
     
    24132413    if (g_getfattr) {
    24142414        get_fattr_list(biggielist, xattr_fname);
    2415         asprintf(&command, "cp %s %s/archives/", xattr_fname,
     2415        (void)asprintf(&command, "cp %s %s/archives/", xattr_fname,
    24162416            bkpinfo->scratchdir);
    24172417        paranoid_system(command);
     
    24202420    if (g_getfacl) {
    24212421        get_acl_list(biggielist, acl_fname);
    2422         asprintf(&command, "cp %s %s/archives/", acl_fname,
     2422        (void)asprintf(&command, "cp %s %s/archives/", acl_fname,
    24232423             bkpinfo->scratchdir);
    24242424        paranoid_system(command);
     
    24282428    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    24292429        res += write_EXAT_files_to_tape(xattr_fname, acl_fname);
    2430         asprintf(&blah, "%ld", count_lines_in_file(biggielist));
     2430        (void)asprintf(&blah, "%ld", count_lines_in_file(biggielist));
    24312431        write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES);
    24322432        paranoid_free(blah);
     
    35553555                "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files",
    35563556                MONDO_LOGFILE, MONDO_CACHE);
    3557         system(tmp);
     3557        (void)system(tmp);
    35583558
    35593559        sprintf(tmp,
    35603560                "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files",
    35613561                MONDO_LOGFILE, MONDO_CACHE);
    3562         system(tmp);
     3562        (void)system(tmp);
    35633563        run_program_and_log_output("umount " MNT_CDROM, FALSE);
    35643564//    if (bkpinfo->backup_media_type != iso && !bkpinfo->please_dont_eject_when_restoring)
Note: See TracChangeset for help on using the changeset viewer.