- Retry when connecting to device fails (bug #528483).
- Avoid busy loop in hpcups when backend has exited (bug #525944).
This commit is contained in:
parent
95e0af4e37
commit
1b0128ab4b
29
hplip-hpcups-sigpipe.patch
Normal file
29
hplip-hpcups-sigpipe.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
diff -up hplip-3.9.8/prnt/hpijs/services.cpp.hpcups-sigpipe hplip-3.9.8/prnt/hpijs/services.cpp
|
||||||
|
--- hplip-3.9.8/prnt/hpijs/services.cpp.hpcups-sigpipe 2009-08-04 22:35:41.000000000 +0100
|
||||||
|
+++ hplip-3.9.8/prnt/hpijs/services.cpp 2009-10-29 11:56:23.015022337 +0000
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
\*****************************************************************************/
|
||||||
|
|
||||||
|
+#include <errno.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
@@ -382,8 +383,16 @@ DRIVER_ERROR UXServices::ToDevice(const
|
||||||
|
if (write(OutputPath, pBuffer, *Count) != (ssize_t)*Count)
|
||||||
|
{
|
||||||
|
static int cnt=0;
|
||||||
|
- if (cnt++ < 5)
|
||||||
|
+ if (cnt < 5)
|
||||||
|
+ {
|
||||||
|
+ cnt++;
|
||||||
|
BUG("unable to write to output, fd=%d, count=%d: %m\n", OutputPath, *Count);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (errno == EPIPE)
|
||||||
|
+ /* The backend has exited. There's no recovering from that. */
|
||||||
|
+ exit (1);
|
||||||
|
+
|
||||||
|
return IO_ERROR;
|
||||||
|
}
|
||||||
|
|
30
hplip-retry-open.patch
Normal file
30
hplip-retry-open.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
diff -up hplip-3.9.8/prnt/backend/hp.c.retry-open hplip-3.9.8/prnt/backend/hp.c
|
||||||
|
--- hplip-3.9.8/prnt/backend/hp.c.retry-open 2009-10-27 11:46:00.181457688 +0000
|
||||||
|
+++ hplip-3.9.8/prnt/backend/hp.c 2009-10-27 11:57:51.527583553 +0000
|
||||||
|
@@ -724,11 +724,21 @@ int main(int argc, char *argv[])
|
||||||
|
/* Open hp device. */
|
||||||
|
while ((stat = hpmud_open_device(argv[0], ma.prt_mode, &hd)) != HPMUD_R_OK)
|
||||||
|
{
|
||||||
|
- if (stat != HPMUD_R_DEVICE_BUSY)
|
||||||
|
- {
|
||||||
|
- BUG("ERROR: cannot open device stat=%d: %s\n", stat, argv[0]);
|
||||||
|
- goto bugout;
|
||||||
|
- }
|
||||||
|
+ if (getenv ("CLASS") != NULL)
|
||||||
|
+ {
|
||||||
|
+ /* If the CLASS environment variable is set we
|
||||||
|
+ * need to give other class members a chance in
|
||||||
|
+ * case their devices are ready to go.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+ BUG("INFO: cannot open device stat=%d: %s\n", stat, argv[0]);
|
||||||
|
+ BUG("INFO: queuing on next printer in class...\n");
|
||||||
|
+
|
||||||
|
+ /* Prevent job requeuing too quickly. */
|
||||||
|
+ sleep (5);
|
||||||
|
+
|
||||||
|
+ goto bugout;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* Display user error. */
|
||||||
|
device_event(argv[0], printer, 5000+stat, argv[2], argv[1], argv[3]);
|
18
hplip.spec
18
hplip.spec
@ -1,7 +1,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 3.9.8
|
Version: 3.9.8
|
||||||
Release: 18%{?dist}
|
Release: 19%{?dist}
|
||||||
License: GPLv2+ and MIT
|
License: GPLv2+ and MIT
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Conflicts: system-config-printer < 0.6.132
|
Conflicts: system-config-printer < 0.6.132
|
||||||
@ -24,7 +24,9 @@ Patch8: hplip-non-scripts.patch
|
|||||||
Patch9: hplip-requirespageregion.patch
|
Patch9: hplip-requirespageregion.patch
|
||||||
Patch10: hplip-discovery-method.patch
|
Patch10: hplip-discovery-method.patch
|
||||||
Patch11: hplip-device-reconnected.patch
|
Patch11: hplip-device-reconnected.patch
|
||||||
Patch12: hplip-plugin-error.patch
|
Patch12: hplip-retry-open.patch
|
||||||
|
Patch13: hplip-plugin-error.patch
|
||||||
|
Patch14: hplip-hpcups-sigpipe.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
Requires(pre): /sbin/service
|
Requires(pre): /sbin/service
|
||||||
@ -147,9 +149,15 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
|
|||||||
# Give up trying to print a job to a reconnected device (bug #515481).
|
# Give up trying to print a job to a reconnected device (bug #515481).
|
||||||
%patch11 -p1 -b .device-reconnected
|
%patch11 -p1 -b .device-reconnected
|
||||||
|
|
||||||
|
# Retry when connecting to device fails (bug #528483).
|
||||||
|
%patch12 -p1 -b .retry-open
|
||||||
|
|
||||||
# Set a printer-state-reason when there's a missing required plugin
|
# Set a printer-state-reason when there's a missing required plugin
|
||||||
# (bug #531330).
|
# (bug #531330).
|
||||||
%patch12 -p1 -b .plugin-error
|
%patch13 -p1 -b .plugin-error
|
||||||
|
|
||||||
|
# Avoid busy loop in hpcups when backend has exited (bug #525944).
|
||||||
|
%patch14 -p1 -b .hpcups-sigpipe
|
||||||
|
|
||||||
%build
|
%build
|
||||||
aclocal
|
aclocal
|
||||||
@ -354,6 +362,10 @@ fi
|
|||||||
/usr/bin/update-desktop-database &>/dev/null ||:
|
/usr/bin/update-desktop-database &>/dev/null ||:
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 29 2009 Tim Waugh <twaugh@redhat.com> 3.9.8-19
|
||||||
|
- Retry when connecting to device fails (bug #528483).
|
||||||
|
- Avoid busy loop in hpcups when backend has exited (bug #525944).
|
||||||
|
|
||||||
* Wed Oct 28 2009 Tim Waugh <twaugh@redhat.com> 3.9.8-18
|
* Wed Oct 28 2009 Tim Waugh <twaugh@redhat.com> 3.9.8-18
|
||||||
- Set a printer-state-reason when there's a missing required plugin
|
- Set a printer-state-reason when there's a missing required plugin
|
||||||
(bug #531330).
|
(bug #531330).
|
||||||
|
Loading…
Reference in New Issue
Block a user