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();