Changeset 1955 in MondoRescue
- Timestamp:
- May 27, 2008, 1:32:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.6/mondo/src/common/libmondo-stream.c
r1954 r1955 679 679 * @param tapedev The tape device to open for reading. 680 680 */ 681 voidskip_obdr()681 int skip_obdr() 682 682 { 683 683 char *command = NULL; 684 684 int res = 0; 685 686 log_it("Skipping OBDR headers"); 685 687 asprintf(&command, "mt -f %s fsf 2",bkpinfo->media_device); 686 r un_program_and_log_output(command, 1);688 res = run_program_and_log_output(command, 1); 687 689 paranoid_free(command); 688 690 689 691 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 690 692 return(res); 691 693 } 692 694 … … 704 706 int res = 0; 705 707 708 log_it("Creating OBDR headers"); 706 709 /* OBDR: First block 10 kB of zero bs = 512 */ 707 710 asprintf(&command, "mt -f %s compression off",bkpinfo->media_device); … … 710 713 711 714 asprintf(&command, "mt -f %s rewind",bkpinfo->media_device); 712 res = run_program_and_log_output(command, 1);715 res += run_program_and_log_output(command, 1); 713 716 paranoid_free(command); 714 717 … … 716 719 717 720 asprintf(&command, "dd if=/dev/zero of=%s bs=512 count=20",bkpinfo->media_device); 718 res = run_program_and_log_output(command, 1);721 res += run_program_and_log_output(command, 1); 719 722 paranoid_free(command); 720 723 … … 723 726 724 727 asprintf(&command, "dd if=%s of=%s bs=2048",MINDI_CACHE"/mondorescue.iso",bkpinfo->media_device); 725 res = run_program_and_log_output(command, 1);728 res += run_program_and_log_output(command, 1); 726 729 paranoid_free(command); 727 730 728 731 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 732 return(res); 729 733 } 730 734 … … 750 754 int i; 751 755 int j; 752 int res ;756 int res = 0; 753 757 long length, templong; 754 758 size_t k; … … 777 781 if ((bkpinfo->use_obdr) && (ntapedev != NULL)) { 778 782 strncpy(bkpinfo->media_device,ntapedev,(size_t)(MAX_STR_LEN / 4)); 779 skip_obdr(); 783 res = skip_obdr(); 784 if (res != 0) { 785 log_it("Not able to skip OBDR - Restore will have to be done manually"); 786 } 780 787 } else { 781 788 if (ntapedev == NULL) { … … 930 937 if (! 931 938 (g_tape_stream = 932 open_device_via_buffer( tapedev, 'w', bkpinfo->internal_tape_block_size))) {939 open_device_via_buffer(bkpinfo->media_device, 'w', bkpinfo->internal_tape_block_size))) { 933 940 log_OS_error(g_tape_fifo); 934 941 log_to_screen("Cannot openin stream device");
Note:
See TracChangeset
for help on using the changeset viewer.