Changeset 2202 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-archive.c
- Timestamp:
- May 13, 2009, 4:34:00 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-archive.c
r2190 r2202 803 803 } 804 804 if (bkpinfo->backup_media_type == usb) { 805 asprintf(&tmp2, "--usb %s", bkpinfo->media_device);805 (void)asprintf(&tmp2, "--usb %s", bkpinfo->media_device); 806 806 } else { 807 asprintf(&tmp2," ");807 (void)asprintf(&tmp2," "); 808 808 } 809 809 … … 828 828 829 829 if (g_getfattr) { 830 asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);830 (void)asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir); 831 831 if (write_one_liner_data_file(tmp1, "TRUE")) { 832 832 log_msg(1, "%ld: Unable to write one-liner XATTR", … … 836 836 } 837 837 if (g_getfacl) { 838 asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);838 (void)asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir); 839 839 if (write_one_liner_data_file(tmp1, "TRUE")) { 840 840 log_msg(1, "%ld: Unable to write one-liner ACL", … … 844 844 } 845 845 if (bkpinfo->use_obdr) { 846 asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir);846 (void)asprintf(&tmp1, "%s/OBDR", bkpinfo->tmpdir); 847 847 if (write_one_liner_data_file(tmp1, "TRUE")) { 848 848 log_msg(1, "%ld: Unable to write one-liner OBDR", … … 1581 1581 log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir); 1582 1582 (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); 1584 1584 run_program_and_log_output(tmp, FALSE); 1585 1585 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", 1589 1589 media_descriptor_string(bkpinfo->backup_media_type), 1590 1590 g_current_media_number); 1591 1591 log_msg(1, message_to_screen); 1592 1592 1593 asprintf(&tmp1, "%s1", bkpinfo->media_device);1593 (void)asprintf(&tmp1, "%s1", bkpinfo->media_device); 1594 1594 if (is_this_device_mounted(tmp1)) { 1595 1595 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); 1597 1597 run_program_and_log_output(tmp, FALSE); 1598 1598 paranoid_free(tmp); … … 1601 1601 1602 1602 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); 1605 1605 run_program_and_log_output(tmp, FALSE); 1606 1606 paranoid_free(tmp); 1607 1607 /* 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); 1609 1609 run_program_and_log_output(tmp, FALSE); 1610 1610 paranoid_free(tmp); … … 1616 1616 1617 1617 /* Command to execute */ 1618 asprintf(&tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1);1618 (void)asprintf(&tmp,"mv %s/* %s", bkpinfo->scratchdir, tmp1); 1619 1619 res = eval_call_to_make_USB(tmp, message_to_screen); 1620 1620 if (res) { 1621 asprintf(&result_sz, "%s ...failed",tmp);1621 (void)asprintf(&result_sz, "%s ...failed",tmp); 1622 1622 } else { 1623 asprintf(&result_sz, "%s ...OK",tmp);1623 (void)asprintf(&result_sz, "%s ...OK",tmp); 1624 1624 } 1625 1625 log_to_screen(result_sz); … … 1632 1632 1633 1633 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); 1635 1635 run_program_and_log_output(tmp, FALSE); 1636 1636 paranoid_free(tmp); 1637 1637 } 1638 1638 1639 chdir(old_pwd);1639 (void)chdir(old_pwd); 1640 1640 if (retval) { 1641 1641 log_msg(1, "WARNING - make_usb_fs returned an error"); … … 1769 1769 ("Failed to write to disk. I shall blank it and then try again."); 1770 1770 sleep(5); 1771 system("sync");1771 (void)system("sync"); 1772 1772 pause_for_N_seconds(5, "Letting DVD drive settle"); 1773 1773 … … 2398 2398 } 2399 2399 2400 asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,2400 (void)asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir, 2401 2401 biggielist); 2402 2402 paranoid_system(command); 2403 2403 paranoid_free(command); 2404 2404 2405 asprintf(&blah, "biggielist = %s", biggielist);2405 (void)asprintf(&blah, "biggielist = %s", biggielist); 2406 2406 log_msg(2, blah); 2407 2407 paranoid_free(blah); … … 2413 2413 if (g_getfattr) { 2414 2414 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, 2416 2416 bkpinfo->scratchdir); 2417 2417 paranoid_system(command); … … 2420 2420 if (g_getfacl) { 2421 2421 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, 2423 2423 bkpinfo->scratchdir); 2424 2424 paranoid_system(command); … … 2428 2428 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2429 2429 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)); 2431 2431 write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES); 2432 2432 paranoid_free(blah); … … 3555 3555 "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", 3556 3556 MONDO_LOGFILE, MONDO_CACHE); 3557 system(tmp);3557 (void)system(tmp); 3558 3558 3559 3559 sprintf(tmp, 3560 3560 "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", 3561 3561 MONDO_LOGFILE, MONDO_CACHE); 3562 system(tmp);3562 (void)system(tmp); 3563 3563 run_program_and_log_output("umount " MNT_CDROM, FALSE); 3564 3564 // if (bkpinfo->backup_media_type != iso && !bkpinfo->please_dont_eject_when_restoring)
Note:
See TracChangeset
for help on using the changeset viewer.