From 0da7f82a8a347f47809b4f9553555b18323089d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juanjo=20Mar=C3=ADn?= Date: Sun, 26 Apr 2009 14:30:49 +0400 Subject: [PATCH] [comics] Correct check for exit status Status of the dvipdfm needs to be checked after exit. Fixes GNOME bug #579656. --- backend/comics/comics-document.c | 4 +++- backend/dvi/dvi-document.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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) -- 2.43.5