[cups.bugs] [HIGH] STR #1816: evaluating usb/parallel status for Linux seems have a logic error

kmuto.debian kmuto at debian.org
Sun Jul 2 03:36:17 PDT 2006


[STR New]

I received many bug reports from Debian users about usb backend always fail
by unknown "Printer fault!".
I noticed parallel and usb backends for Linux had a problem around
evaluating the status.
I think !(status &LP_PERRORP) and !(status & LP_PSELCTED) don't
need !() expressions for the intention. 

--- backend/parallel.c    2006-07-02 19:25:49.000000000 +0900
+++ backend/parallel.c     2006-07-02 19:26:51.000000000 +0900
@@ -271,9 +271,9 @@
       paperout = 1;
     }

-    if (!(status & LP_PERRORP))
+    if (status & LP_PERRORP)
       fputs("WARNING: Printer fault!\n", stderr);
-    else if (!(status & LP_PSELECD))
+    else if (status & LP_PSELECD)
       fputs("WARNING: Printer off-line.\n", stderr);
     else
       break;

--- backend/usb-unix.c    2006-07-02 19:25:49.000000000 +0900
+++ backend/usb-unix.c     2006-07-02 19:25:50.000000000 +0900
@@ -168,9 +168,9 @@
       paperout = 1;
     }

-    if (!(status & LP_PERRORP))
+    if (status & LP_PERRORP)
       fputs("WARNING: Printer fault!\n", stderr);
-    else if (!(status & LP_PSELECD))
+    else if (status & LP_PSELECD)
       fputs("WARNING: Printer off-line.\n", stderr);
     else
       break;

Link: http://www.cups.org/str.php?L1816
Version: 1.2-current





More information about the cups mailing list