rpms/apcupsd/F-7 apcupsd-3.14.1-linux-usb.patch,NONE,1.1

Orion Poplawski (orion) fedora-extras-commits at redhat.com
Mon Jul 2 15:49:31 UTC 2007


Author: orion

Update of /cvs/pkgs/rpms/apcupsd/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3514

Added Files:
	apcupsd-3.14.1-linux-usb.patch 
Log Message:
Add patch for linux USB UPS detection (bug #245864)


apcupsd-3.14.1-linux-usb.patch:

--- NEW FILE apcupsd-3.14.1-linux-usb.patch ---
--- apcupsd-3.14.1/src/drivers/usb/linux/linux-usb.c.linux-usb	2007/05/02 00:26:52	1.26.6.1
+++ apcupsd-3.14.1/src/drivers/usb/linux/linux-usb.c	2007/06/29 22:18:41	1.26.6.2
@@ -114,20 +114,17 @@
    if (fd >= 0) {
       /* Check for the UPS application HID usage */
       for (i = 0; (ret = ioctl(fd, HIDIOCAPPLICATION, i)) > 0; i++) {
-         if ((ret & 0xffff000) == (UPS_USAGE & 0xffff0000))
-            break;
-      }
-      /* If we found the UPS application usage, we're good to go */     
-      if (ret) {
-         /* Request full uref reporting from read() */
-         if (FORCE_COMPAT24 || ioctl(fd, HIDIOCSFLAG, &flaguref)) {
-            Dmsg0(100, "HIDIOCSFLAG failed; enabling linux-2.4 "
-                   "compatibility mode\n");
-            my_data->compat24 = true;
+         if ((ret & 0xffff000) == (UPS_USAGE & 0xffff0000)) {
+            /* Request full uref reporting from read() */
+            if (FORCE_COMPAT24 || ioctl(fd, HIDIOCSFLAG, &flaguref)) {
+               Dmsg0(100, "HIDIOCSFLAG failed; enabling linux-2.4 "
+                      "compatibility mode\n");
+               my_data->compat24 = true;
+            }
+            /* Successfully opened the device */
+            Dmsg1(200, "Successfully opened \"%s\"\n", dev);
+            return fd;
          }
-         /* Successfully opened the device */
-         Dmsg1(200, "Successfully opened \"%s\"\n", dev);
-         return fd;
       }
       close(fd);
    }




More information about the scm-commits mailing list