b1d80f
diff -up hplip-3.9.8/prnt/hpijs/services.cpp.hpcups-sigpipe hplip-3.9.8/prnt/hpijs/services.cpp
b1d80f
--- hplip-3.9.8/prnt/hpijs/services.cpp.hpcups-sigpipe	2009-08-04 22:35:41.000000000 +0100
b1d80f
+++ hplip-3.9.8/prnt/hpijs/services.cpp	2009-10-29 11:56:23.015022337 +0000
b1d80f
@@ -29,6 +29,7 @@
b1d80f
     POSSIBILITY OF SUCH DAMAGE.
b1d80f
 \*****************************************************************************/
b1d80f
 
b1d80f
+#include <errno.h>
b1d80f
 #include <sys/stat.h>
b1d80f
 #include <stdio.h>
b1d80f
 #include <stdlib.h>
b1d80f
@@ -382,8 +383,16 @@ DRIVER_ERROR UXServices::ToDevice(const 
b1d80f
    if (write(OutputPath, pBuffer, *Count) != (ssize_t)*Count) 
b1d80f
    {
b1d80f
       static int cnt=0;
b1d80f
-      if (cnt++ < 5)
b1d80f
+      if (cnt < 5)
b1d80f
+      {
b1d80f
+	 cnt++;
b1d80f
          BUG("unable to write to output, fd=%d, count=%d: %m\n", OutputPath, *Count);
b1d80f
+      }
b1d80f
+
b1d80f
+      if (errno == EPIPE)
b1d80f
+	 /* The backend has exited.  There's no recovering from that. */
b1d80f
+	 exit (1);
b1d80f
+
b1d80f
       return IO_ERROR;
b1d80f
    }
b1d80f