1b044ba
diff -up ghostscript-8.70/cups/pdftoraster.c.pdftoraster-exit ghostscript-8.70/cups/pdftoraster.c
1b044ba
--- ghostscript-8.70/cups/pdftoraster.c.pdftoraster-exit	2008-10-17 23:58:21.000000000 +0100
1b044ba
+++ ghostscript-8.70/cups/pdftoraster.c	2010-01-25 10:15:42.269209639 +0000
1b044ba
@@ -35,6 +35,8 @@ MIT Open Source License  -  http://www.o
1b044ba
 #include <stdarg.h>
1b044ba
 #include <fcntl.h>
1b044ba
 #include <cups/raster.h>
1b044ba
+#include <sys/types.h>
1b044ba
+#include <sys/wait.h>
1b044ba
 
1b044ba
 #define MAX_CHECK_COMMENT_LINES	20
1b044ba
 #ifndef GS
1b044ba
@@ -123,6 +125,7 @@ int main(int argc, char *argv[], char *e
1b044ba
   const char* apos;
1b044ba
   int fds[2];
1b044ba
   int pid;
1b044ba
+  int status;
1b044ba
 
1b044ba
   parseOpts(argc, argv);
1b044ba
 
1b044ba
@@ -502,8 +505,17 @@ int main(int argc, char *argv[], char *e
1b044ba
       }
1b044ba
     }
1b044ba
     fclose(fp);
1b044ba
+    close (fds[1]);
1b044ba
   }
1b044ba
 
1b044ba
-  exit(0);
1b044ba
+  if (waitpid (pid, &status, 0) == -1) {
1b044ba
+    perror (GS);
1b044ba
+    exit (1);
1b044ba
+  }
1b044ba
+
1b044ba
+  if (WIFEXITED (status))
1b044ba
+    exit(WEXITSTATUS (status));
1b044ba
+  else
1b044ba
+    exit(1);
1b044ba
 }
1b044ba