Changeset 3060 in MondoRescue for branches/3.0/mondo/src/common/libmondo-archive.c
- Timestamp:
- Nov 10, 2012, 5:05:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/libmondo-archive.c
r3056 r3060 1023 1023 char *curr_acl_list_fname; 1024 1024 1025 struct s_bkpinfo *bkpinfo_bis;1026 1025 char *tmp; 1027 1026 int res = 0, retval = 0; … … 1041 1040 p_next_set_to_archive = (int *) (inbuf + 8); 1042 1041 p_list_of_fileset_flags = (char *) (inbuf + 12); 1043 bkpinfo_bis = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);1044 1042 1045 1043 sprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ, … … 1597 1595 1598 1596 log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir); 1599 (void)getcwd(old_pwd, MAX_STR_LEN - 1);1597 tmp1 = getcwd(old_pwd, MAX_STR_LEN - 1); 1600 1598 mr_asprintf(&tmp, "chmod 700 %s", bkpinfo->scratchdir); 1601 1599 run_program_and_log_output(tmp, FALSE); 1602 1600 paranoid_free(tmp); 1603 (void)chdir(bkpinfo->scratchdir); 1601 if (chdir(bkpinfo->scratchdir)) { 1602 // FIXME 1603 } 1604 1604 1605 1605 mds = media_descriptor_string(bkpinfo->backup_media_type); … … 1660 1660 } 1661 1661 1662 (void)chdir(old_pwd); 1662 if (chdir(old_pwd)) { 1663 // FIXME 1664 } 1663 1665 if (retval) { 1664 1666 log_msg(1, "WARNING - make_usb_fs returned an error"); … … 1734 1736 log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", 1735 1737 bkpinfo->scratchdir, destfile); 1736 (void)getcwd(old_pwd, MAX_STR_LEN - 1);1738 tmp2 = getcwd(old_pwd, MAX_STR_LEN - 1); 1737 1739 sprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1738 1740 run_program_and_log_output(tmp, FALSE); 1739 chdir(bkpinfo->scratchdir); 1741 if (chdir(bkpinfo->scratchdir)) { 1742 // FIXME 1743 } 1740 1744 1741 1745 if (bkpinfo->call_before_iso[0] != '\0') { … … 1796 1800 /* reset error counter before trying to blank DVD */ 1797 1801 retval -= res; 1798 (void)system("sync");1802 paranoid_system("sync"); 1799 1803 pause_for_N_seconds(5, "Letting DVD drive settle"); 1800 1804 … … 1984 1988 } 1985 1989 1986 chdir(old_pwd); 1990 if (chdir(old_pwd)) { 1991 // FIXME 1992 } 1987 1993 if (retval) { 1988 1994 log_msg(1, "WARNING - make_iso_fs returned an error"); … … 2040 2046 FILE *fin; 2041 2047 char *p; 2048 char *q; 2042 2049 2043 2050 /*@ buffers ******************************************** */ … … 2090 2097 2091 2098 malloc_string(bigfile_fname); 2092 for ( fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin);2093 fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) {2099 for (q = fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin) && (q != NULL); 2100 q = fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) { 2094 2101 use_ntfsprog = FALSE; 2095 2102 if (bigfile_fname[strlen(bigfile_fname) - 1] < 32) { … … 2621 2628 /*@ long long ****************************************************** */ 2622 2629 off_t length_of_incoming_file = (off_t)0; 2623 t_archtype type;2624 2630 va_list ap; 2625 2631 … … 2643 2649 write_header_block_to_stream(length_of_incoming_file, curr_file, 2644 2650 start_chr); 2645 if (strstr(curr_file, ".afio.") || strstr(curr_file, ".star.")) {2646 type = fileset;2647 } else if (strstr(curr_file, "slice")) {2648 type = biggieslice;2649 } else {2650 type = other;2651 }2652 2651 res = write_file_to_stream_from_file(curr_file); 2653 2652 retval += res; … … 2977 2976 off_t totalread = (off_t)0; 2978 2977 off_t totallength = (off_t)0; 2979 off_t length;2980 2978 2981 2979 /*@ int ******************************************************** */ … … 3036 3034 } 3037 3035 mr_free(command); 3038 (void)fgets(checksum_line, MAX_STR_LEN, fin);3036 tmp = fgets(checksum_line, MAX_STR_LEN, fin); 3039 3037 pclose(fin); 3040 3038 totallength = length_of_file (biggie_filename); … … 3061 3059 paranoid_free(tmp); 3062 3060 3063 (void)fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);3061 res = fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout); 3064 3062 if (fout != NULL) { 3065 3063 paranoid_fclose(fout); 3066 3064 } 3067 length = totallength / optimal_set_size / 1024;3068 3065 log_msg(1, "Opening in %s; slicing it and writing to CD/tape", 3069 3066 file_to_openin); … … 3110 3107 if (blksize > 0) { 3111 3108 totalread = totalread + blksize; 3112 (void)fwrite(tempblock, 1, blksize, fout);3109 res = fwrite(tempblock, 1, blksize, fout); 3113 3110 } else { 3114 3111 break; … … 3417 3414 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds); 3418 3415 mr_free(mds); 3419 chdir("/"); 3416 if (chdir("/")) { 3417 // FIXME 3418 } 3420 3419 log_it("Before calling verification of image()"); 3421 3420 if (bkpinfo->backup_media_type == usb) { … … 3497 3496 assert(bkpinfo != NULL); 3498 3497 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 3499 chdir("/"); 3498 if (chdir("/")) { 3499 // FIXME 3500 } 3500 3501 mvaddstr_and_log_it(g_currentY, 0, 3501 3502 "Verifying archives against live filesystem"); … … 3518 3519 find_cdrom_device(bkpinfo->media_device, FALSE); // replace 0,0,0 with /dev/cdrom 3519 3520 } 3520 chdir("/"); 3521 if (chdir("/")) { 3522 // FIXME 3523 } 3521 3524 for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) { 3522 3525 if (cdno != g_current_media_number) { … … 3541 3544 } 3542 3545 mr_asprintf(&tmp, "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE); 3543 (void)system(tmp);3546 res = system(tmp); 3544 3547 mr_free(tmp); 3545 3548 3546 3549 mr_asprintf(&tmp, "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE); 3547 (void)system(tmp);3550 res = system(tmp); 3548 3551 mr_free(tmp); 3549 3552 run_program_and_log_output("umount " MNT_CDROM, FALSE);
Note:
See TracChangeset
for help on using the changeset viewer.