diff options
Diffstat (limited to 'converter/other/tifftopnm.c')
-rw-r--r-- | converter/other/tifftopnm.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c index 0d6494f9..f9e602ff 100644 --- a/converter/other/tifftopnm.c +++ b/converter/other/tifftopnm.c @@ -782,14 +782,22 @@ spawnWithInputPipe(const char * const shellCmd, else *errorP = NULL; } else { - int rc; + int terminationStatus; close(fd[PIPE_WRITE]); close(STDIN_FILENO); dup2(fd[PIPE_READ], STDIN_FILENO); - rc = system(shellCmd); + terminationStatus = system(shellCmd); - exit(rc); + if (WIFSIGNALED(terminationStatus)) + pm_error("Shell process was killed " + "by a Class %u signal.", + WTERMSIG(terminationStatus)); + else if (!WIFEXITED(terminationStatus)) + pm_error("Shell process died, but its termination status " + "0x%x doesn't make sense", terminationStatus); + else + exit(WEXITSTATUS(terminationStatus)); } } } |