]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/dvi-document.c
[comics] Correct check for exit status
[evince.git] / backend / dvi / dvi-document.c
index a6c33408c14d4c741b94e98440b6172e313eb7fb..a1097c94563d4b775db61b9a1108bb6149e94813 100644 (file)
@@ -32,6 +32,8 @@
 
 #include <glib/gi18n-lib.h>
 #include <ctype.h>
+#include <sys/wait.h>
+#include <stdlib.h>
 
 GMutex *dvi_context_mutex = NULL;
 
@@ -398,8 +400,8 @@ dvi_document_file_exporter_end (EvFileExporter *exporter)
 
        if (success == FALSE) {
                g_warning ("Error: %s", err->message);
-       } else if (exit_stat != 0) {
-               g_warning ("Error: dvipdfm exited with non-zero status.");
+       } else if (!WIFEXITED(exit_stat) || WEXITSTATUS(exit_stat) != EXIT_SUCCESS){
+               g_warning ("Error: dvipdfm does not end normally or exit with a failure status.");
        }
 
        if (err)