diff -urNad cups-1.4.0~/backend/usb-libusb.c cups-1.4.0/backend/usb-libusb.c --- cups-1.4.0~/backend/usb-libusb.c 2009-08-08 00:24:14.000000000 +0200 +++ cups-1.4.0/backend/usb-libusb.c 2009-09-02 16:37:31.000000000 +0200 @@ -158,7 +158,7 @@ while (poll(pfds, 2, -1) > 0) { - if (pfds[0].revents & POLLIN) + if (pfds[0].revents & (POLLIN + POLLHUP)) { if ((bytes = read(print_fd, buffer, sizeof(buffer))) > 0) { @@ -179,7 +179,12 @@ } if (pfds[1].revents & POLLIN) - tbytes += side_cb(printer, print_fd); + { + if ((bytes = side_cb(printer, print_fd)) < 0) + pfds[1].events = 0; /* Filter has gone away... */ + else + tbytes += bytes; + } } } @@ -747,7 +752,7 @@ if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) { _cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n")); - return (0); + return (-1); } switch (command)