cups-direct-usb.patch 912 B

12345678910111213141516171819202122232425262728
  1. diff -up cups-1.5b1/backend/usb-unix.c.direct-usb cups-1.5b1/backend/usb-unix.c
  2. --- cups-1.5b1/backend/usb-unix.c.direct-usb 2011-05-20 05:49:49.000000000 +0200
  3. +++ cups-1.5b1/backend/usb-unix.c 2011-05-23 17:52:14.000000000 +0200
  4. @@ -102,6 +102,9 @@ print_device(const char *uri, /* I - De
  5. _cups_strncasecmp(hostname, "Minolta", 7);
  6. #endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
  7. + if (use_bc && !strncmp(uri, "usb:/dev/", 9))
  8. + use_bc = 0;
  9. +
  10. if ((device_fd = open_device(uri, &use_bc)) == -1)
  11. {
  12. if (getenv("CLASS") != NULL)
  13. @@ -331,12 +334,7 @@ open_device(const char *uri, /* I - Dev
  14. if (!strncmp(uri, "usb:/dev/", 9))
  15. #ifdef __linux
  16. {
  17. - /*
  18. - * Do not allow direct devices anymore...
  19. - */
  20. -
  21. - errno = ENODEV;
  22. - return (-1);
  23. + return (open(uri + 4, O_RDWR | O_EXCL));
  24. }
  25. else if (!strncmp(uri, "usb://", 6))
  26. {