]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
driverless: Exit with 0 if no driverless IPP printers found
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 8 Jun 2021 09:34:27 +0000 (11:34 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 15 Jun 2021 18:57:06 +0000 (20:57 +0200)
(cherry picked from commit 78b6b2c9875863352924eb937590f7ad7790c23f)

NEWS
utils/driverless.c

diff --git a/NEWS b/NEWS
index 433061fcd074fb2995da243892fde96df91c8fbf..9c0a27e4073099456de4219c2cc6ef6c89a4d6ea 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,11 @@ NEWS - OpenPrinting CUPS Filters v1.28.8 - 2021-03-25
 
 CHANGES IN V1.28.9
 
+       - driverless: If there are no driverless IPP printers
+         available let "driverless" terminate with exit code 0 and
+         not 1, to follow CUPS' standard of backends in discovery
+         mode terminating with 0 if there are no appropriate printers
+         found (Issue #375).
        - gstoraster, foomatic-rip: Fixed Ghostscript command line for
          counting pages as it took too long on PDFs from evince when
          printing DjVu files (Issue #354, Pull request #371, Ubuntu
index 55db7eef508d2af84e8f99ca935766d13bd71beb..294d466f0dc1e99eeb5880c85fb22cd38ea161a6 100644 (file)
@@ -572,7 +572,7 @@ list_printers (int mode, int reg_type_no, int isFax)
   if (WIFEXITED(wait_status)) {
     /* Via exit() anywhere or return() in the main() function */
     exit_status = WEXITSTATUS(wait_status);
-    if (exit_status)
+    if (exit_status > 1)
       fprintf(stderr, "ERROR: ippfind (PID %d) stopped with status %d!\n",
              ippfind_pid, exit_status);
   } else if (WIFSIGNALED(wait_status) && WTERMSIG(wait_status) != SIGTERM) {
@@ -582,7 +582,7 @@ list_printers (int mode, int reg_type_no, int isFax)
       fprintf(stderr, "ERROR: ippfind (PID %d) stopped on signal %d!\n",
              ippfind_pid, exit_status);
   }
-  if (!exit_status && debug)
+  if (exit_status < 2 && debug)
     fprintf(stderr, "DEBUG: ippfind (PID %d) exited with no errors.\n",
            ippfind_pid);
 
@@ -593,7 +593,7 @@ list_printers (int mode, int reg_type_no, int isFax)
  error:
   cupsArrayDelete(service_uri_list_ipps);
   cupsArrayDelete(service_uri_list_ipp);
-  return (exit_status);
+  return (exit_status < 2 ? 0 : exit_status);
 }
 
 int