Magellan Linux

Contents of /trunk/pilot-link/patches/pilot-link-0.12.4-libusb-compat-usb_open.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 847 - (show annotations) (download)
Fri Jun 12 17:42:06 2009 UTC (15 years, 4 months ago) by niro
File size: 715 byte(s)
-patches for pilot-link

1 With libusb-compat, usb_open() calls must be checked for their return value, as
2 NULL is now returned on failure.
3
4 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
5
6 diff -Nuar pilot-link-0.12.3.orig/libpisock/libusb.c pilot-link-0.12.3/libpisock/libusb.c
7 --- pilot-link-0.12.3.orig/libpisock/libusb.c 2007-02-09 08:06:22.000000000 -0800
8 +++ pilot-link-0.12.3/libpisock/libusb.c 2009-05-18 17:32:16.316895284 -0700
9 @@ -141,6 +141,12 @@
10
11 LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: USB_handle=%p\n",
12 __FILE__, USB_handle));
13 +
14 + if(USB_handle == NULL) {
15 + LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: Unable to open device.\n",
16 + __FILE__));
17 + continue;
18 + }
19
20 data->ref = USB_handle;
21