summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2019-08-16 15:41:00 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2019-08-16 15:41:00 -0400
commit60a7373f31976afa757bd7a1250b49b392f7189a (patch)
treedf81531c5f732d1d04082b24d24843b360307f91 /backend
parent2c030c7a06e0c2b8227c7e85f5c58dfb339731d0 (diff)
downloadcups-60a7373f31976afa757bd7a1250b49b392f7189a.tar.gz
Fix a USB printing issue on macOS (rdar://31433931)
Diffstat (limited to 'backend')
-rw-r--r--backend/usb-darwin.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c
index d6ad5875d..8f37e1bd6 100644
--- a/backend/usb-darwin.c
+++ b/backend/usb-darwin.c
@@ -1279,6 +1279,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
(*printerIntf)->GetAlternateSetting(printerIntf, &intfAltSetting);
(*printerIntf)->GetInterfaceNumber(printerIntf, &intfNumber);
(*printerIntf)->GetLocationID(printerIntf, &intfLocation);
+
+ if (intfProtocol == kUSBPrintingProtocolIPP)
+ return keepLooking;
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
{
@@ -1287,12 +1290,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
g.interfaceProtocol = intfProtocol;
g.location = intfLocation;
g.alternateSetting = intfAltSetting;
- if (intfProtocol != kUSBPrintingProtocolIPP)
- {
- g.printer_obj = obj;
- IOObjectRetain(obj);
- }
- keepLooking = (intfProtocol == kUSBPrintingProtocolIPP);
+ g.printer_obj = obj;
+ IOObjectRetain(obj);
+ keepLooking = false;
}
}
else
@@ -1300,14 +1300,14 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
if (g.printer_obj != 0)
IOObjectRelease(g.printer_obj);
+ if (g.location == 0 || g.location == intfLocation)
+ keepLooking = false;
+
g.location = intfLocation;
g.alternateSetting = intfAltSetting;
g.interfaceProtocol = intfProtocol;
g.printer_obj = obj;
IOObjectRetain(obj);
-
- if (g.location == 0 || g.location == intfLocation)
- keepLooking = false;
}
if (!keepLooking)