Changeset 688 in MondoRescue for trunk/mondo/mondo/common/libmondo-verify.c
- Timestamp:
- Jul 17, 2006, 3:44:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-verify.c
r507 r688 5 5 * Functions for verifying backups (booted from hard drive, not CD). 6 6 */ 7 8 #include <unistd.h> 7 9 8 10 #include "my-stuff.h" … … 59 61 60 62 asprintf(&afio_found_changes, "%s.afio", ignorefiles_fname); 61 paranoid_system("sync");63 sync(); 62 64 63 65 /* sprintf (command, … … 193 195 { 194 196 195 /*@ buffer ********************************************************** */196 char *tmp ;197 char * mountpoint;198 // char ca, cb;199 char *command ;200 char *sz_exe ;197 char *tmp = NULL; 198 char *tmp1 = NULL; 199 char *tmp2 = NULL; 200 char *mountpoint = NULL; 201 char *command = NULL; 202 char *sz_exe = NULL; 201 203 static char *bufblkA = NULL; 202 204 static char *bufblkB = NULL; 203 205 const long maxbufsize = 65536L; 204 long currsizA = 0; 205 long currsizB = 0; 206 long j; 207 208 /*@ long ************************************************************ */ 209 long bigfile_num = 0; 206 long currsizA = 0L; 207 long currsizB = 0L; 208 long j = 0L; 209 long bigfile_num = 0L; 210 210 long slice_num = -1; 211 int res ;211 int res = 0; 212 212 213 213 static FILE *forig = NULL; … … 215 215 static long last_bigfile_num = -1; 216 216 static long last_slice_num = -1; 217 FILE *pin ;218 FILE *fin ;217 FILE *pin = NULL; 218 FILE *fin = NULL; 219 219 int retval = 0; 220 // long long outlen; 221 222 malloc_string(sz_exe); 220 223 221 if (!bufblkA) { 224 222 if (!(bufblkA = malloc(maxbufsize))) { … … 251 249 open_evalcall_form(tmp); 252 250 paranoid_free(tmp); 251 253 252 iamhere("after vsbf"); 254 253 asprintf(&mountpoint, "%s/archives", mtpt); … … 263 262 slice_num = last_slice_num + 1; 264 263 } 265 while (does_file_exist 266 (slice_fname 267 (bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix)) 268 || 269 does_file_exist(slice_fname 270 (bigfile_num, slice_num, mountpoint, ""))) { 271 // handle slices until end of CD 264 265 tmp = slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix); 266 tmp1 = slice_fname(bigfile_num, slice_num, mountpoint, ""); 267 while (does_file_exist(tmp) || does_file_exist(tmp1)) { 268 // handle slices until end of CD 272 269 if (slice_num == 0) { 273 270 log_msg(2, "ISO=%d bigfile=%ld --START--", 274 271 g_current_media_number, bigfile_num); 275 if (! 276 (fin = 277 fopen(slice_fname(bigfile_num, slice_num, mountpoint, ""), 278 "r"))) { 272 if (!(fin = fopen(tmp1,"r"))) { 279 273 log_msg(2, "Cannot open bigfile's info file"); 280 274 } else { … … 286 280 paranoid_fclose(fin); 287 281 } 288 asprintf(&tmp , "%s/%s", bkpinfo->restore_path,282 asprintf(&tmp2, "%s/%s", bkpinfo->restore_path, 289 283 biggiestruct.filename); 290 log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp );291 if (!(forig = fopen(tmp , "r"))) {284 log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp2); 285 if (!(forig = fopen(tmp2, "r"))) { 292 286 log_msg(2, "Failed to open bigfile. Darn."); 293 287 retval++; 294 288 } 295 paranoid_free(tmp );289 paranoid_free(tmp2); 296 290 297 291 slice_num++; 298 } else if (does_file_exist 299 (slice_fname(bigfile_num, slice_num, mountpoint, ""))) { 292 } else if (does_file_exist(tmp1)) { 300 293 log_msg(2, "ISO=%d bigfile=%ld ---END---", 301 294 g_current_media_number, bigfile_num); … … 307 300 g_current_media_number, bigfile_num, slice_num); 308 301 if (bkpinfo->compression_level > 0) { 309 asprintf(&command, "%s -dc %s 2>> %s", sz_exe, 310 slice_fname(bigfile_num, slice_num, mountpoint, 311 bkpinfo->zip_suffix), 312 MONDO_LOGFILE); 302 asprintf(&command, "%s -dc %s 2>> %s", sz_exe, tmp, MONDO_LOGFILE); 313 303 } else { 314 asprintf(&command, "cat %s", 315 slice_fname(bigfile_num, slice_num, mountpoint, 316 bkpinfo->zip_suffix)); 304 asprintf(&command, "cat %s", tmp); 317 305 } 318 306 if ((pin = popen(command, "r"))) { … … 356 344 } 357 345 } 346 paranoid_free(tmp); 347 paranoid_free(tmp1); 358 348 paranoid_free(mountpoint); 359 349 paranoid_free(sz_exe); … … 1072 1062 1073 1063 /* find the final blocks */ 1074 paranoid_system("sync");1064 sync(); 1075 1065 sleep(2); 1076 1066 closein_tape(bkpinfo);
Note:
See TracChangeset
for help on using the changeset viewer.