rpms/hplip/F-11 hplip-device-reconnected.patch, NONE, 1.1 hplip.spec, 1.232, 1.233
Tim Waugh
twaugh at fedoraproject.org
Tue Sep 29 16:09:56 UTC 2009
Author: twaugh
Update of /cvs/pkgs/rpms/hplip/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11925
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-14
- 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/F-11/hplip.spec,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -p -r1.232 -r1.233
--- hplip.spec 23 Sep 2009 09:40:42 -0000 1.232
+++ hplip.spec 29 Sep 2009 16:09:56 -0000 1.233
@@ -1,7 +1,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.9.8
-Release: 13%{?dist}
+Release: 14%{?dist}
License: GPLv2+ and MIT
Group: System Environment/Daemons
Conflicts: system-config-printer < 0.6.132
@@ -24,6 +24,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
@@ -143,6 +144,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
@@ -360,6 +364,9 @@ fi
exit 0
%changelog
+* Tue Sep 29 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-14
+- 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-13
- Enable parallel port support when configuring (bug #524979).
- Fixed hp-setup traceback when discovery page is skipped (bug #523685).
More information about the fedora-extras-commits
mailing list