hplip-hpcups-sigpipe.patch 938 B

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