rpms/cups/devel cups-usb-paperout.patch, 1.1, 1.2 cups.spec, 1.331, 1.332

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Tue Jun 12 09:24:29 UTC 2007


Author: twaugh

Update of /cvs/pkgs/rpms/cups/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23606

Modified Files:
	cups-usb-paperout.patch cups.spec 
Log Message:
* Tue Jun 12 2007 Tim Waugh <twaugh at redhat.com>
- Better paper-out detection patch (bug #241589).


cups-usb-paperout.patch:

Index: cups-usb-paperout.patch
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups-usb-paperout.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cups-usb-paperout.patch	25 Apr 2007 17:10:11 -0000	1.1
+++ cups-usb-paperout.patch	12 Jun 2007 09:24:24 -0000	1.2
@@ -1,5 +1,5 @@
 --- cups-1.2.10/backend/runloop.c.usb-paperout	2006-12-06 20:10:16.000000000 +0000
-+++ cups-1.2.10/backend/runloop.c	2007-04-25 18:00:59.000000000 +0100
++++ cups-1.2.10/backend/runloop.c	2007-05-29 19:21:32.000000000 +0100
 @@ -40,6 +40,14 @@
  #endif /* __hpux */
  
@@ -25,7 +25,52 @@
  
  
    fprintf(stderr, "DEBUG: backendRunLoop(print_fd=%d, device_fd=%d, use_bc=%d)\n",
-@@ -227,6 +238,9 @@
+@@ -110,12 +121,9 @@
+     FD_ZERO(&input);
+     if (!print_bytes)
+       FD_SET(print_fd, &input);
+-    if (use_bc)
+-      FD_SET(device_fd, &input);
+ 
+     FD_ZERO(&output);
+-    if (print_bytes || !use_bc)
+-      FD_SET(device_fd, &output);
++    FD_SET(device_fd, &output);
+ 
+     if (use_bc)
+     {
+@@ -141,14 +149,24 @@
+     * Check if we have back-channel data ready...
+     */
+ 
+-    if (FD_ISSET(device_fd, &input))
++    if (use_bc && FD_ISSET(device_fd, &output)) /* finished writing */
+     {
+-      if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
++      struct timeval nowait;
++      fd_set readback;
++      FD_ZERO (&readback);
++      nowait.tv_sec = 0;
++      nowait.tv_usec = 0;
++      FD_SET(device_fd, &readback);
++      if (select (device_fd + 1, &readback, NULL, NULL, &nowait) &&
++	  FD_ISSET(device_fd, &readback))
+       {
+-	fprintf(stderr,
+-	        "DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
+-	        CUPS_LLCAST bc_bytes);
+-        cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
++	if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
++	{
++	  fprintf(stderr,
++		  "DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
++		  CUPS_LLCAST bc_bytes);
++	  cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
++	}
+       }
+     }
+ 
+@@ -227,6 +245,9 @@
        }
        else
        {
@@ -35,7 +80,7 @@
          if (paperout)
  	{
  	  fputs("STATE: -media-empty-error\n", stderr);
-@@ -247,7 +261,42 @@
+@@ -247,7 +268,42 @@
  	total_bytes += bytes;
        }
      }
@@ -78,8 +123,8 @@
  
   /*
    * Return with success...
---- cups-1.2.10/backend/usb-unix.c.usb-paperout	2007-04-25 17:50:06.000000000 +0100
-+++ cups-1.2.10/backend/usb-unix.c	2007-04-25 17:50:06.000000000 +0100
+--- cups-1.2.10/backend/usb-unix.c.usb-paperout	2007-05-29 19:10:08.000000000 +0100
++++ cups-1.2.10/backend/usb-unix.c	2007-05-29 19:10:08.000000000 +0100
 @@ -39,6 +39,11 @@
  #include "ieee1284.c"
  #include <sys/select.h>


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -r1.331 -r1.332
--- cups.spec	9 May 2007 14:17:40 -0000	1.331
+++ cups.spec	12 Jun 2007 09:24:24 -0000	1.332
@@ -156,7 +156,7 @@
 %patch22 -p1 -b .af_unix-auth
 %patch23 -p1 -b .str2323
 %patch24 -p1 -b .str2109
-#%patch25 -p1 -b .usb-paperout
+%patch25 -p1 -b .usb-paperout
 %patch26 -p1 -b .str2348
 
 %if %lspp
@@ -444,6 +444,9 @@
 %{cups_serverbin}/daemon/cups-lpd
 
 %changelog
+* Tue Jun 12 2007 Tim Waugh <twaugh at redhat.com>
+- Better paper-out detection patch (bug #241589).
+
 * Wed May  9 2007 Tim Waugh <twaugh at redhat.com> 1:1.2.10-10
 * Revert paper-out detection for the moment.
 




More information about the fedora-extras-commits mailing list