[evince/gnome-2-26] [backends] Correct check for exit status
- From: Nickolay V. Shmyrev <nshmyrev src gnome org>
- To: svn-commits-list gnome org
- Subject: [evince/gnome-2-26] [backends] Correct check for exit status
- Date: Sun, 26 Apr 2009 06:33:28 -0400 (EDT)
commit ff986c162f4bcc39240399efc0be02d1e772ff1e
Author: Juanjo MarÃn <juanj marin juntadeandalucia es>
Date: Sun Apr 26 14:32:53 2009 +0400
[backends] 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 dc5a8b0..7d450d0 100644
--- a/backend/comics/comics-document.c
+++ b/backend/comics/comics-document.c
@@ -24,6 +24,8 @@
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
+#include <sys/wait.h>
+#include <stdlib.h>
#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 a6c3340..a1097c9 100644
--- a/backend/dvi/dvi-document.c
+++ b/backend/dvi/dvi-document.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]