One more small error handling fix

This commit is contained in:
Hans de Goede 2012-03-14 16:57:50 +01:00
parent cd757587c6
commit 671c062c1a
6 changed files with 42 additions and 5 deletions

View File

@ -0,0 +1,32 @@
From 1cc5b4a9fb984e83681ae5c797fa6b22bc20f809 Mon Sep 17 00:00:00 2001
From: Ludovic Rousseau <ludovic.rousseau+github@gmail.com>
Date: Fri, 16 Sep 2011 18:07:56 +0200
Subject: [PATCH 01/40] Correctly handle LIBUSB_TRANSFER_OVERFLOW in
libusb_control_transfer()
sync.c: In function `libusb_control_transfer':
sync.c:122: warning: enumeration value `LIBUSB_TRANSFER_OVERFLOW' not
handled in switch
Fixes #120.
---
libusb/sync.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libusb/sync.c b/libusb/sync.c
index d50413b..8eed47b 100644
--- a/libusb/sync.c
+++ b/libusb/sync.c
@@ -132,6 +132,9 @@ int API_EXPORTED libusb_control_transfer(libusb_device_handle *dev_handle,
case LIBUSB_TRANSFER_NO_DEVICE:
r = LIBUSB_ERROR_NO_DEVICE;
break;
+ case LIBUSB_TRANSFER_OVERFLOW:
+ r = LIBUSB_ERROR_OVERFLOW;
+ break;
default:
usbi_warn(HANDLE_CTX(dev_handle),
"unrecognised status code %d", transfer->status);
--
1.7.9.3

View File

@ -1,7 +1,7 @@
Summary: A library which allows userspace access to USB devices
Name: libusb1
Version: 1.0.9
Release: 0.5.rc1%{?dist}
Release: 0.6.rc1%{?dist}
# This is a git snapshot of what will hopefully soon become 1.0.9, but
# we need this now, to get things in place for:
# http://fedoraproject.org/wiki/Features/UsbNetworkRedirection
@ -15,10 +15,11 @@ Release: 0.5.rc1%{?dist}
Source0: libusb-1.0.9-rc1.tar.bz2
#Source0: http://downloads.sourceforge.net/libusb/libusb-%{version}.tar.bz2
Patch1: 0001-linux-Fix-cancel_transfer-return-value-when-cancelli.patch
Patch2: 0002-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch
Patch3: 0003-linux-Fix-handling-of-urb-status-codes.patch
Patch4: 0004-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch
Patch1: 0001-Correctly-handle-LIBUSB_TRANSFER_OVERFLOW-in-libusb_.patch
Patch2: 0002-linux-Fix-cancel_transfer-return-value-when-cancelli.patch
Patch3: 0003-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch
Patch4: 0004-linux-Fix-handling-of-urb-status-codes.patch
Patch5: 0005-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch
License: LGPLv2+
Group: System Environment/Libraries
@ -64,6 +65,7 @@ This package contains static libraries to develop applications that use libusb1.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%configure --libdir=/%{_lib}
@ -107,6 +109,9 @@ mv %{buildroot}/%{_lib}/pkgconfig/* %{buildroot}%{_libdir}/pkgconfig/
/%{_lib}/*.a
%changelog
* Wed Mar 14 2012 Hans de Goede <hdegoede@redhat.com> - 1.0.9-0.6.rc1
- One more small error handling fix
* Wed Mar 14 2012 Hans de Goede <hdegoede@redhat.com> - 1.0.9-0.5.rc1
- Add some small error handling fixes