ALT Linux Bugzilla
– Attachment 3085 Details for
Bug 17955
nut works bad with current libusb
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Первая версия исправления hidups-usb
nut-usb.patch (text/plain), 1.38 KB, created by
Alexander Bokovoy
on 2008-11-23 22:09:58 MSK
(
hide
)
Description:
Первая версия исправления hidups-usb
Filename:
MIME Type:
Creator:
Alexander Bokovoy
Created:
2008-11-23 22:09:58 MSK
Size:
1.38 KB
patch
obsolete
>diff --git a/nut/drivers/libusb.c b/nut/drivers/libusb.c >index b6f5fb5..5a519ba 100644 >--- a/nut/drivers/libusb.c >+++ b/nut/drivers/libusb.c >@@ -208,7 +208,10 @@ static int libusb_open(usb_dev_handle **udevp, USBDevice_t *curDevice, USBDevice > #endif > > /* set default interface */ >- usb_set_altinterface(udev, 0); >+ if (usb_set_altinterface(udev, 0) < 0) { >+ upsdebugx(2, " Couldn't set default interface"); >+ goto next_device; >+ } > > if (!callback) { > return 1; >diff --git a/nut/drivers/usbhid-ups.c b/nut/drivers/usbhid-ups.c >index 4824189..3ffa1e2 100644 >--- a/nut/drivers/usbhid-ups.c >+++ b/nut/drivers/usbhid-ups.c >@@ -84,7 +84,7 @@ static int pollfreq = DEFAULT_POLLFREQ; > static int ups_status = 0; > static bool_t data_has_changed = FALSE; /* for SEMI_STATIC data polling */ > static time_t lastpoll; /* Timestamp the last polling */ >-hid_dev_handle_t udev; >+hid_dev_handle_t udev = NULL; > > /* support functions */ > static hid_info_t *find_nut_info(const char *varname); >@@ -1360,7 +1360,9 @@ static int reconnect_ups(void) > upsdebugx(4, "=================================================="); > upsdebugx(4, "= device has been disconnected, try to reconnect ="); > upsdebugx(4, "=================================================="); >- >+ if (udev) >+ comm_driver->close(udev); >+ > ret = comm_driver->open(&udev, &curDevice, subdriver_matcher, > #ifdef SHUT_MODE > NULL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 17955
: 3085