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