From 671c062c1a8d3285a0a4d54fa746c3403086de6a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 14 Mar 2012 16:57:50 +0100 Subject: [PATCH] One more small error handling fix --- ...-LIBUSB_TRANSFER_OVERFLOW-in-libusb_.patch | 32 +++++++++++++++++++ ..._transfer-return-value-when-cancelli.patch | 0 ...rs-when-cancel_transfer-fails-with-N.patch | 0 ...nux-Fix-handling-of-urb-status-codes.patch | 0 ...linux-iso-pkt-status-codes-to-libusb.patch | 0 libusb1.spec | 15 ++++++--- 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 0001-Correctly-handle-LIBUSB_TRANSFER_OVERFLOW-in-libusb_.patch rename 0001-linux-Fix-cancel_transfer-return-value-when-cancelli.patch => 0002-linux-Fix-cancel_transfer-return-value-when-cancelli.patch (100%) rename 0002-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch => 0003-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch (100%) rename 0003-linux-Fix-handling-of-urb-status-codes.patch => 0004-linux-Fix-handling-of-urb-status-codes.patch (100%) rename 0004-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch => 0005-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch (100%) diff --git a/0001-Correctly-handle-LIBUSB_TRANSFER_OVERFLOW-in-libusb_.patch b/0001-Correctly-handle-LIBUSB_TRANSFER_OVERFLOW-in-libusb_.patch new file mode 100644 index 0000000..4f727f0 --- /dev/null +++ b/0001-Correctly-handle-LIBUSB_TRANSFER_OVERFLOW-in-libusb_.patch @@ -0,0 +1,32 @@ +From 1cc5b4a9fb984e83681ae5c797fa6b22bc20f809 Mon Sep 17 00:00:00 2001 +From: Ludovic Rousseau +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 + diff --git a/0001-linux-Fix-cancel_transfer-return-value-when-cancelli.patch b/0002-linux-Fix-cancel_transfer-return-value-when-cancelli.patch similarity index 100% rename from 0001-linux-Fix-cancel_transfer-return-value-when-cancelli.patch rename to 0002-linux-Fix-cancel_transfer-return-value-when-cancelli.patch diff --git a/0002-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch b/0003-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch similarity index 100% rename from 0002-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch rename to 0003-Don-t-print-errors-when-cancel_transfer-fails-with-N.patch diff --git a/0003-linux-Fix-handling-of-urb-status-codes.patch b/0004-linux-Fix-handling-of-urb-status-codes.patch similarity index 100% rename from 0003-linux-Fix-handling-of-urb-status-codes.patch rename to 0004-linux-Fix-handling-of-urb-status-codes.patch diff --git a/0004-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch b/0005-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch similarity index 100% rename from 0004-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch rename to 0005-linux-Translate-linux-iso-pkt-status-codes-to-libusb.patch diff --git a/libusb1.spec b/libusb1.spec index bf2e1e8..4bae17b 100644 --- a/libusb1.spec +++ b/libusb1.spec @@ -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 - 1.0.9-0.6.rc1 +- One more small error handling fix + * Wed Mar 14 2012 Hans de Goede - 1.0.9-0.5.rc1 - Add some small error handling fixes