rpms/hplip/devel hplip-device-reconnected.patch, NONE, 1.1 hplip.spec, 1.238, 1.239

Tim Waugh twaugh at fedoraproject.org
Tue Sep 29 15:25:48 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/hplip/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv546

Modified Files:
	hplip.spec 
Added Files:
	hplip-device-reconnected.patch 
Log Message:
* Tue Sep 29 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-17
- Give up trying to print a job to a reconnected device (bug #515481).


hplip-device-reconnected.patch:
 hp.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- NEW FILE hplip-device-reconnected.patch ---
diff -up hplip-3.9.8/prnt/backend/hp.c.device-reconnected hplip-3.9.8/prnt/backend/hp.c
--- hplip-3.9.8/prnt/backend/hp.c.device-reconnected	2009-09-29 16:02:14.717467334 +0100
+++ hplip-3.9.8/prnt/backend/hp.c	2009-09-29 16:02:20.019342096 +0100
@@ -638,6 +638,7 @@ int main(int argc, char *argv[])
    HPMUD_DEVICE hd=-1;
    HPMUD_CHANNEL cd=-1;
    int n, total=0, retry=0, size, pages;
+   int consecutive_failures=0;
    enum HPMUD_RESULT stat;
    char *printer = getenv("PRINTER"); 
    
@@ -789,10 +790,23 @@ int main(int argc, char *argv[])
                /* IO error, get printer status. */
                if (loop_test(hd, cd, &pa, argv[0], printer, argv[2], argv[1], argv[3]))
                   goto bugout;
+
+               if (++consecutive_failures == 5)
+               {
+                  /* hpmud_write_channel has failed several times in
+                   * succession but the Device ID-based status says
+                   * the printer is happy.  Time to face the fact that
+                   * the device has probably reconnected, and our USB
+                   * channel is invalidated. */
+
+                  BUG("ERROR: device reconnected?");
+                  goto bugout;
+               }
             }
             else
             {
                /* Data was sent to device successfully. */ 
+               consecutive_failures = 0;
                if (pa.pjl_device)
                {
                   /* Laserjets have a large data buffer, so manually check for operator intervention condition. */


Index: hplip.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hplip/devel/hplip.spec,v
retrieving revision 1.238
retrieving revision 1.239
diff -u -p -r1.238 -r1.239
--- hplip.spec	23 Sep 2009 09:32:54 -0000	1.238
+++ hplip.spec	29 Sep 2009 15:25:47 -0000	1.239
@@ -1,7 +1,7 @@
 Summary: HP Linux Imaging and Printing Project
 Name: hplip
 Version: 3.9.8
-Release: 16%{?dist}
+Release: 17%{?dist}
 License: GPLv2+ and MIT
 Group: System Environment/Daemons
 Conflicts: system-config-printer < 0.6.132
@@ -23,6 +23,7 @@ Patch7: hplip-parenths.patch
 Patch8: hplip-non-scripts.patch
 Patch9: hplip-requirespageregion.patch
 Patch10: hplip-discovery-method.patch
+Patch11: hplip-device-reconnected.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires(pre): /sbin/service
@@ -142,6 +143,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
 # Fixed hp-setup traceback when discovery page is skipped (bug #523685).
 %patch10 -p1 -b .discovery-method
 
+# Give up trying to print a job to a reconnected device (bug #515481).
+%patch11 -p1 -b .device-reconnected
+
 %build
 aclocal
 automake --foreign --add-missing --copy
@@ -345,6 +349,9 @@ fi
 /usr/bin/update-desktop-database &>/dev/null ||:
 
 %changelog
+* Tue Sep 29 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-17
+- Give up trying to print a job to a reconnected device (bug #515481).
+
 * Wed Sep 23 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-16
 - Enable parallel port support when configuring (bug #524979).
 




More information about the scm-commits mailing list