1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
diff -uNr partimage-0.6.6.orig/src/client/interface_none.cpp partimage-0.6.6/src/client/interface_none.cpp
--- partimage-0.6.6.orig/src/client/interface_none.cpp 2006-04-22 16:24:14.000000000 +0200
+++ partimage-0.6.6/src/client/interface_none.cpp 2008-01-14 01:48:22.000000000 +0100
@@ -96,7 +96,8 @@
void CInterfaceNone::msgBoxError(char *title, ...) {
va_list al;
va_start(al,title);
- message_only("Error", title, "", al, 0);
+ vfprintf(stderr,title,al);
+ fputc('\n',stderr);
va_end(al);
}
diff -uNr partimage-0.6.6.orig/src/client/main.cpp partimage-0.6.6/src/client/main.cpp
--- partimage-0.6.6.orig/src/client/main.cpp 2008-01-14 01:44:21.000000000 +0100
+++ partimage-0.6.6/src/client/main.cpp 2008-01-14 01:47:46.000000000 +0100
@@ -139,6 +139,12 @@
}*/
}
+void ensure_interface_is_non_interactive()
+{
+ delete g_interface;
+ g_interface = new CInterfaceNone("");
+}
+
// =======================================================
int main(int argc, char *argv[])
{
@@ -579,8 +585,9 @@
goto beginMainWin;
}
- if (!options.bBatchMode)
- g_interface -> Error(excep, szImageFile, szDevice);
+ if (options.bBatchMode) ensure_interface_is_non_interactive();
+
+ g_interface -> Error(excep, szImageFile, szDevice);
showDebug(1, "\nFINAL ERROR\n\n");
@@ -591,8 +598,11 @@
else
{
showDebug(1, "The file system of [%s] is [%s], and is not supported\n", szDevice, szFileSystem);
- if (!options.bBatchMode)
- g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem);
+
+ if (options.bBatchMode) ensure_interface_is_non_interactive();
+
+ g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem);
+
nRes = -1;
}
//#endif // DEVEL_SUPPORT
@@ -696,7 +706,7 @@
{
if (options.bBatchMode)
fprintf(stderr,"\n\n");
- g_interface -> StatusLine(i18n("commiting buffer cache to disk."));
+ if (!options.bBatchMode) g_interface -> StatusLine(i18n("commiting buffer cache to disk."));
sync();
}
closeDebugFiles();
|