Ticket #187: diff_mondo-rstr-compare.c

File diff_mondo-rstr-compare.c, 2.4 KB (added by Scott Cummings, 17 years ago)
Line 
1--- mondo-rstr-compare.c.2.2.4 2007-07-23 23:52:59.000000000 -0500
2+++ mondo-rstr-compare.c 2007-07-26 17:42:32.000000000 -0500
3@@ -375,8 +375,9 @@
4 retval += res;
5 if (res) {
6 log_OS_error(command);
7 sprintf(tmp, "Warning - afio returned error = %d", res);
8+/* log msg 'tmp' ? */
9 }
10 if (length_of_file(logfile) > 5) {
11 sprintf(command,
12 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> /tmp/changed.txt",
13@@ -535,8 +536,9 @@
14 getcwd(cwd, MAX_STR_LEN - 1);
15 chdir(bkpinfo->restore_path);
16 getcwd(new, MAX_STR_LEN - 1);
17 sprintf(tmp, "new path is %s", new);
18+ log_msg(2, tmp);
19 insist_on_this_cd_number(bkpinfo, g_current_media_number);
20 unlink("/tmp/changed.txt");
21
22 resA = compare_all_tarballs(bkpinfo);
23@@ -586,12 +588,13 @@
24 struct raidlist_itself *raidlist)
25 {
26 int retval = 0;
27 long q;
28- char *tmp;
29+ char *tmp, *cwd, *new;
30
31 malloc_string(tmp);
32-
33+ malloc_string(cwd);
34+ malloc_string(new);
35 /**************************************************************************
36 * also deletes tmp/filelist.full & tmp/biggielist.txt _and_ tries to *
37 * restore them from start of tape, if available *
38 **************************************************************************/
39@@ -631,9 +634,8 @@
40 0,
41 "Warning - differences found during the compare phase");
42 }
43
44- retval += unmount_all_devices(mountlist);
45
46 if (count_lines_in_file("/tmp/changed.txt") > 0) {
47 mvaddstr_and_log_it(g_currentY++, 0,
48 "Differences found while files were being compared.");
49@@ -655,17 +657,26 @@
50 mvaddstr_and_log_it(g_currentY++, 0, tmp);
51 log_to_screen(tmp);
52
53 log_msg(2, "calling popup_changelist_from_file()");
54+ getcwd(cwd, MAX_STR_LEN - 1);
55+ chdir(bkpinfo->restore_path);
56+ getcwd(new, MAX_STR_LEN - 1);
57+ sprintf(tmp, "new path is %s", new);
58+ log_msg(2, tmp);
59 popup_changelist_from_file("/tmp/changed.files");
60+ chdir(cwd);
61 log_msg(2, "Returning from popup_changelist_from_file()");
62 }
63 } else {
64 log_to_screen
65 ("No significant differences were found. Your backup is perfect.");
66 }
67+ retval += unmount_all_devices(mountlist);
68 kill_petris();
69 paranoid_free(tmp);
70+ paranoid_free(cwd);
71+ paranoid_free(new);
72 return (retval);
73 }
74
75 /**************************************************************************