LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cups-1.4svn-pdftops_dont_fail_on_cancel.patch of Package cups (Project DISCONTINUED:openSUSE:11.1)

Index: pdftops.c
===================================================================
--- cups-1.4svn/filter/pdftops.c	(revision 7480)
+++ cups-1.4svn/filter/pdftops.c	(revision 7481)
@@ -327,23 +327,21 @@
     * Parent comes here...
     */
 
-    while ((pdfwaitpid = wait(&pdfstatus)) < 0 && errno == EINTR)
+    while ((pdfwaitpid = wait(&pdfstatus)) != pdfpid && errno == EINTR)
     {
      /*
       * Wait until we get a valid process ID or the job is canceled...
       */
 
       if (job_canceled)
-	break;
+      {
+        kill(pdfpid, SIGTERM);
+	job_canceled = 0;
+      }
     }
 
-    if (pdfwaitpid != pdfpid)
+    if (pdfstatus)
     {
-      kill(pdfpid, SIGTERM);
-      pdfstatus = 1;
-    }
-    else if (pdfstatus)
-    {
       if (WIFEXITED(pdfstatus))
       {
 	pdfstatus = WEXITSTATUS(pdfstatus);