Changeset 2009 in MondoRescue for trunk/mondo/src/mondorestore/mondo-rstr-compare.c
- Timestamp:
- Aug 11, 2008, 3:05:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/mondorestore/mondo-rstr-compare.c
r1086 r2009 4 4 */ 5 5 6 #include <pthread.h> 6 7 #include "my-stuff.h" 7 8 #include "../common/mondostructures.h" 8 9 #include "../common/libmondo.h" 10 #include "mr_msg.h" 11 #include "mr_mem.h" 9 12 #include "mr-externs.h" 10 13 #include "mondo-rstr-compare.h" 11 14 #include "mondo-restore-EXT.h" 12 15 #include "mondo-rstr-tools-EXT.h" 13 #ifndef S_SPLINT_S 14 #include <pthread.h> 15 #endif 16 #include "mr_mem.h" 16 17 //static char cvsid[] = "$Id$"; 17 18 18 19 void popup_changelist_from_file(char *); … … 32 33 { 33 34 34 FILE *fin ;35 FILE *fout ;35 FILE *fin = NULL; 36 FILE *fout = NULL; 36 37 37 38 /** needs malloc *******/ … … 62 63 } 63 64 if (!(fin = fopen(tmp1, "r"))) { 64 mr_asprintf(&tmp, _("Cannot open bigfile %ld (%s)'s info file"), 65 bigfileno + 1, tmp); 66 log_to_screen(tmp); 67 mr_free(tmp); 65 log_to_screen(_("Cannot open bigfile %ld (%s)'s info file"), 66 bigfileno + 1, tmp1); 68 67 mr_free(tmp1); 69 68 return (1); … … 74 73 paranoid_fclose(fin); 75 74 76 mr_asprintf(&checksum, biggiestruct.checksum);77 75 mr_asprintf(&bigfile_fname, biggiestruct.filename); 78 79 76 mr_msg(2, "biggiestruct.filename = %s", bigfile_fname); 80 mr_msg(2, "biggiestruct.checksum = %s", checksum); 77 if (!biggiestruct.checksum[0]) { 78 mr_msg(2, "Warning - %s has no checksum", bigfile_fname); 79 } else { 80 mr_asprintf(&checksum, biggiestruct.checksum); 81 mr_msg(2, "biggiestruct.checksum = %s", checksum); 82 } 81 83 82 84 if (!g_text_mode) { … … 86 88 mr_free(tmp); 87 89 } 88 /* BERLIOS: Useless ? 89 if (!checksum[0]) { 90 mr_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr); 91 } */ 90 92 91 if (!strncmp(bigfile_fname, "/dev/", 5)) { 93 92 mr_msg(2, _("Ignoring device %s"), bigfile_fname); 93 mr_free(bigfile_fname); 94 94 return(0); 95 } else { 96 mr_asprintf(&command, 97 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors.txt", 98 MNT_RESTORING, bigfile_fname); 99 } 95 } 96 mr_asprintf(&command, 97 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors.txt", 98 MNT_RESTORING, bigfile_fname); 100 99 mr_msg(2, command); 101 paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null");102 100 if (system(command)) { 103 101 log_OS_error("Warning - command failed"); 102 paranoid_system("cat /tmp/errors >> /tmp/mondo-restore.log 2> /dev/null"); 104 103 mr_free(command); 105 104 mr_free(bigfile_fname); … … 157 156 { 158 157 int retval = 0; 159 int res ;160 long noof_biggiefiles , bigfileno = 0;161 char *tmp ;158 int res = 0; 159 long noof_biggiefiles = 0L, bigfileno = 0L; 160 char *tmp = NULL; 162 161 163 162 assert(bkpinfo != NULL); … … 186 185 update_progress_form(tmp); 187 186 mr_free(tmp); 187 188 188 res = compare_a_biggiefile(bkpinfo, bigfileno); 189 189 retval += res; … … 218 218 { 219 219 int retval = 0; 220 int res; 221 long noof_lines; 222 long archiver_errors; 223 bool use_star; 224 225 /*** needs malloc *********/ 220 int res = 0; 221 long noof_lines = 0L; 222 long archiver_errors = 0L; 223 bool use_star = FALSE; 224 226 225 char *command = NULL; 227 226 char *tmp = NULL; … … 242 241 mr_asprintf(&compressor_exe, "bzip2"); 243 242 } else if (strstr(tarball_fname, ".gz")) { 244 strcpy(compressor_exe, "gzip"); 245 } else if (strstr(tarball_fname, ".gz")) { 246 strcpy(compressor_exe, "gzip"); 243 mr_asprintf(&compressor_exe, "gzip"); 247 244 } else if (strstr(tarball_fname, ".lzo")) { 248 245 mr_asprintf(&compressor_exe, "lzop"); … … 275 272 } 276 273 } 277 // star -diff H=star -bz file=....278 274 279 275 #ifdef __FreeBSD__ … … 317 313 archiver_errors = 0; 318 314 } 319 320 315 if (archiver_errors) { 321 mr_asprintf(&tmp, 322 "Differences found while processing fileset #%d ", 316 mr_msg(1, "Differences found while processing fileset #%d ", 323 317 current_tarball_number); 324 mr_msg(1, tmp);325 mr_free(tmp);326 318 } 327 319 unlink(logfile); … … 343 335 { 344 336 int retval = 0; 345 int res ;337 int res = 0; 346 338 int current_tarball_number = 0; 347 348 /** needs malloc **********/349 339 350 340 char *tarball_fname = NULL; 351 341 char *progress_str = NULL; 352 342 char *tmp = NULL; 353 long max_val ;343 long max_val = 0L; 354 344 355 345 assert(bkpinfo != NULL); … … 415 405 } else { 416 406 res = compare_a_tarball(tarball_fname, current_tarball_number); 417 mr_free(tarball_fname);418 419 407 g_current_progress++; 420 408 current_tarball_number++; 421 409 } 410 mr_free(tarball_fname); 422 411 } 423 412 mr_free(progress_str); … … 457 446 int resA = 0; 458 447 int resB = 0; 459 long noof_changed_files ;448 long noof_changed_files = 0L; 460 449 461 450 malloc_string(cwd); … … 475 464 noof_changed_files = count_lines_in_file("/tmp/changed.txt"); 476 465 if (noof_changed_files) { 477 mr_asprintf(&tmp,_("%ld files do not match the backup "),466 log_to_screen(_("%ld files do not match the backup "), 478 467 noof_changed_files); 479 // mvaddstr_and_log_it( g_currentY++, 0, tmp );480 log_to_screen(tmp);481 mr_free(tmp);482 483 468 mr_asprintf(&command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE); 484 469 paranoid_system(command); … … 517 502 { 518 503 int retval = 0; 519 long q ;520 char *tmp ;504 long q = 0L; 505 char *tmp = NULL; 521 506 522 507 /************************************************************************** … … 633 618 run_program_and_log_output(command, FALSE); 634 619 mr_free(command); 620 635 621 mvaddstr_and_log_it(g_currentY, 636 622 0, _("Verifying archives against filesystem")); … … 680 666 int compare_to_tape(struct s_bkpinfo *bkpinfo) 681 667 { 682 int res ;668 int res = 0; 683 669 char *dir = NULL; 684 670 char *command = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.