]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/usb-libusb.c
Update ipp documentation to reflect the behavior of configuring WiFi on IPP USB printers.
[thirdparty/cups.git] / backend / usb-libusb.c
index 7ec9a6d6e0a2cc21a376a0215ccccd486660847b..d7c762392924fcfbd5251d885e13d77d7f4bf6e0 100644 (file)
@@ -1,9 +1,10 @@
 /*
  * LIBUSB interface code for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2020 by Apple Inc.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -825,8 +826,7 @@ find_device(usb_cb_t   cb,          /* I - Callback function */
   err = libusb_init(NULL);
   if (err)
   {
-    fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
-                    "libusb error %i\n", (int)err);
+    fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
     return (NULL);
   }
 
@@ -878,7 +878,7 @@ find_device(usb_cb_t   cb,          /* I - Callback function */
           protocol   = 0;
 
          for (altset = 0, altptr = ifaceptr->altsetting;
-              altset < ifaceptr->num_altsetting;
+              altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type]
               altset ++, altptr ++)
           {
           /*
@@ -1742,8 +1742,7 @@ static void *read_thread(void *reference)
     * Make sure this loop executes no more than once every 250 miliseconds...
     */
 
-    if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
-        (g.wait_eof || !g.read_thread_stop))
+    if ((g.wait_eof || !g.read_thread_stop))
     {
       gettimeofday(&now, NULL);
       if (timercmp(&now, &end, <))