Index: backend/usb-libusb.c =================================================================== --- backend/usb-libusb.c (revision 8809) +++ backend/usb-libusb.c (working copy) @@ -158,7 +158,16 @@ while (poll(pfds, 2, -1) > 0) { - if (pfds[0].revents & POLLIN) + /* + * CUPS STR #3318: USB process hangs on end-of-file, making further + * printing impossible + * + * From a strict interpretation of POSIX poll(), POLLHUP should never be + * set without POLLIN, since POLLIN is the event you request. That said, + * it appears that some versions of Linux break this. + */ + + if (pfds[0].revents & (POLLIN | POLLHUP)) { if ((bytes = read(print_fd, buffer, sizeof(buffer))) > 0) { @@ -178,7 +187,7 @@ break; } - if (pfds[1].revents & POLLIN) + if (pfds[1].revents & (POLLIN | POLLHUP)) { if ((bytes = side_cb(printer, print_fd)) < 0) pfds[1].events = 0; /* Filter has gone away... */