1 diff -up cups-1.5b1/backend/usb-unix.c.usb-paperout cups-1.5b1/backend/usb-unix.c
2 --- cups-1.5b1/backend/usb-unix.c.usb-paperout 2011-05-24 15:51:39.000000000 +0200
3 +++ cups-1.5b1/backend/usb-unix.c 2011-05-24 15:51:39.000000000 +0200
6 #include <sys/select.h>
9 +#include <sys/ioctl.h>
10 +#include <linux/lp.h>
16 @@ -334,7 +339,19 @@ open_device(const char *uri, /* I - Dev
17 if (!strncmp(uri, "usb:/dev/", 9))
20 - return (open(uri + 4, O_RDWR | O_EXCL));
21 + fd = open(uri + 4, O_RDWR | O_EXCL);
26 + * Tell the driver to return from write() with errno==ENOSPACE
30 + ioctl (fd, LPABORT, &t);
35 else if (!strncmp(uri, "usb://", 6))
37 @@ -400,7 +417,14 @@ open_device(const char *uri, /* I - Dev
38 if (!strcmp(uri, device_uri))
41 - * Yes, return this file descriptor...
42 + * Yes, tell the driver to return from write() with
43 + * errno==ENOSPACE on paper-out.
46 + ioctl (fd, LPABORT, &t);
49 + * Return this file descriptor...
52 fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n",