| --- partimage-0.6.4/src/client/main.cpp.pix 2004-02-04 01:57:36.000000000 +0100 |
| +++ partimage-0.6.4/src/client/main.cpp 2005-10-20 17:02:36.000000000 +0200 |
| @@ -133,6 +133,12 @@ |
| }*/ |
| } |
| |
| +void ensure_interface_is_non_interactive() |
| +{ |
| + delete g_interface; |
| + g_interface = new CInterfaceNone(""); |
| +} |
| + |
| // ======================================================= |
| int main(int argc, char *argv[]) |
| { |
| @@ -568,8 +574,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"); |
| |
| @@ -580,8 +587,10 @@ |
| 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 |
| @@ -661,7 +670,7 @@ |
| // update the disk IO |
| if (options.bSync) |
| { |
| - g_interface -> StatusLine(i18n("commiting buffer cache to disk.")); |
| + if (!options.bBatchMode) g_interface -> StatusLine(i18n("commiting buffer cache to disk.")); |
| sync(); |
| } |
| |
| --- partimage-0.6.4/src/client/interface_none.cpp.pix 2004-02-04 01:57:36.000000000 +0100 |
| +++ partimage-0.6.4/src/client/interface_none.cpp 2005-10-20 17:03:01.000000000 +0200 |
| @@ -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); |
| } |
| |