Skip to content

Commit

Permalink
[comics] Correct check for exit status
Browse files Browse the repository at this point in the history
Status of the dvipdfm needs to be checked after exit. Fixes
GNOME bug #579656.
  • Loading branch information
Juanjo Marín authored and Nickolay V. Shmyrev committed Apr 26, 2009
1 parent fd6cd4e commit 0da7f82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/comics/comics-document.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions backend/dvi/dvi-document.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#include <glib/gi18n-lib.h>
#include <ctype.h>
#include <sys/wait.h>
#include <stdlib.h>

GMutex *dvi_context_mutex = NULL;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0da7f82

Please sign in to comment.