rpms/hplip/F-11 hplip-hpcups-sigpipe.patch, NONE, 1.1 hplip.spec, 1.235, 1.236

Tim Waugh twaugh at fedoraproject.org
Thu Oct 29 12:23:26 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/hplip/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7638

Modified Files:
	hplip.spec 
Added Files:
	hplip-hpcups-sigpipe.patch 
Log Message:
* Thu Oct 29 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-17
- Avoid busy loop in hpcups when backend has exited (bug #525944).


hplip-hpcups-sigpipe.patch:
 services.cpp |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- NEW FILE hplip-hpcups-sigpipe.patch ---
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;
    }
 


Index: hplip.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hplip/F-11/hplip.spec,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -p -r1.235 -r1.236
--- hplip.spec	28 Oct 2009 17:41:08 -0000	1.235
+++ hplip.spec	29 Oct 2009 12:23:26 -0000	1.236
@@ -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
@@ -27,6 +27,7 @@ Patch10: hplip-discovery-method.patch
 Patch11: hplip-device-reconnected.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)
 
 Requires(pre): /sbin/service
@@ -156,6 +157,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
 # (bug #531330).
 %patch13 -p1 -b .plugin-error
 
+# Avoid busy loop in hpcups when backend has exited (bug #525944).
+%patch14 -p1 -b .hpcups-sigpipe
+
 %build
 aclocal
 automake --foreign --add-missing --copy
@@ -373,6 +377,9 @@ fi
 exit 0
 
 %changelog
+* Thu Oct 29 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-17
+- Avoid busy loop in hpcups when backend has exited (bug #525944).
+
 * Wed Oct 28 2009 Tim Waugh <twaugh at redhat.com> 3.9.8-16
 - Set a printer-state-reason when there's a missing required plugin
   (bug #531330).




More information about the fedora-extras-commits mailing list