From 1f2242fcbc33a3ce758d53c930a24c6241c9af38 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 10 2020 11:30:46 +0000 Subject: Apply patch cups-direct-usb.patch patch_name: cups-direct-usb.patch present_in_specfile: true --- diff --git a/backend/usb-unix.c b/backend/usb-unix.c index 41a5606..004f116 100644 --- a/backend/usb-unix.c +++ b/backend/usb-unix.c @@ -93,6 +93,9 @@ print_device(const char *uri, /* I - Device URI */ _cups_strncasecmp(hostname, "Minolta", 7); #endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */ + if (use_bc && !strncmp(uri, "usb:/dev/", 9)) + use_bc = 0; + if ((device_fd = open_device(uri, &use_bc)) == -1) { if (getenv("CLASS") != NULL) @@ -315,12 +318,7 @@ open_device(const char *uri, /* I - Device URI */ if (!strncmp(uri, "usb:/dev/", 9)) #ifdef __linux { - /* - * Do not allow direct devices anymore... - */ - - errno = ENODEV; - return (-1); + return (open(uri + 4, O_RDWR | O_EXCL)); } else if (!strncmp(uri, "usb://", 6)) {