From: | "Robin H. Johnson (robbat2)" <robbat2@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in dev-libs/libusb/files: libusb-0.1.12-no-infinite-bulk.patch |
Date: | Wed, 25 Jun 2008 03:25:51 |
Message-Id: | E1KBLdh-0007M7-MR@stork.gentoo.org |
1 | robbat2 08/06/25 03:25:45 |
2 | |
3 | Added: libusb-0.1.12-no-infinite-bulk.patch |
4 | Log: |
5 | Bug #225879, fix infinite looping during usb_bulk operations. |
6 | (Portage version: 2.2_rc1/cvs/Linux 2.6.26-rc4-00103-g1beee8d x86_64) |
7 | |
8 | Revision Changes Path |
9 | 1.1 dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch |
10 | |
11 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch?rev=1.1&view=markup |
12 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch?rev=1.1&content-type=text/plain |
13 | |
14 | Index: libusb-0.1.12-no-infinite-bulk.patch |
15 | =================================================================== |
16 | Patch-from: http://bugs.gentoo.org/show_bug.cgi?id=225879 |
17 | Gentoo-Bug: 225879 |
18 | Signed-off-by: Robin H. Johnson <robbat2@g.o> |
19 | |
20 | Prevents an infinite loop if device is removed during usb_bulk_read or |
21 | usb_bulk_write. |
22 | |
23 | diff -Naur libusb-0.1.12/linux.c libusb-0.1.12-new/linux.c |
24 | --- libusb-0.1.12/linux.c 2006-03-04 04:52:46.000000000 +0200 |
25 | +++ libusb-0.1.12-new/linux.c 2008-06-11 14:22:20.000000000 +0300 |
26 | @@ -220,6 +220,13 @@ |
27 | waiting = 1; |
28 | context = NULL; |
29 | while (!urb.usercontext && ((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) { |
30 | + if (ret == -1) |
31 | + { |
32 | + if (errno == ENODEV) |
33 | + { |
34 | + return -ENODEV; |
35 | + } |
36 | + } |
37 | tv.tv_sec = 0; |
38 | tv.tv_usec = 1000; // 1 msec |
39 | select(dev->fd + 1, NULL, &writefds, NULL, &tv); //sub second wait |
40 | |
41 | |
42 | |
43 | -- |
44 | gentoo-commits@l.g.o mailing list |