From: Juanjo MarĂ­n Date: Sun, 26 Apr 2009 10:30:49 +0000 (+0400) Subject: [comics] Correct check for exit status X-Git-Tag: EVINCE_2_27_1~60 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=0da7f82a8a347f47809b4f9553555b18323089d9;p=evince.git [comics] Correct check for exit status Status of the dvipdfm needs to be checked after exit. Fixes GNOME bug #579656. --- diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index dc5a8b0d..7d450d01 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include "comics-document.h" #include "ev-document-misc.h" @@ -179,7 +181,7 @@ comics_document_load (EvDocument *document, if (!success) { return FALSE; - } else if (retval != 0) { + } else if (!WIFEXITED(retval) || WEXITSTATUS(retval) != EXIT_SUCCESS) { g_set_error_literal (error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_INVALID, diff --git a/backend/dvi/dvi-document.c b/backend/dvi/dvi-document.c index a6c33408..a1097c94 100644 --- a/backend/dvi/dvi-document.c +++ b/backend/dvi/dvi-document.c @@ -32,6 +32,8 @@ #include #include +#include +#include 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)