1 diff -up cups-1.4b1/backend/usb-unix.c.usb-paperout cups-1.4b1/backend/usb-unix.c
2 --- cups-1.4b1/backend/usb-unix.c.usb-paperout 2008-11-12 09:30:03.000000000 +0000
3 +++ cups-1.4b1/backend/usb-unix.c 2008-11-12 09:30:03.000000000 +0000
6 #include <sys/select.h>
9 +#include <sys/ioctl.h>
10 +#include <linux/lp.h>
16 @@ -324,7 +329,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 @@ -390,7 +407,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",