[libgphoto2] Correctly report errors when performing USB control transfers (bug #1201048).

Tim Waugh twaugh at fedoraproject.org
Thu Mar 12 11:05:40 UTC 2015


commit f5ceca94e5b2a70df0162c711d56f35a585b5dd5
Author: Tim Waugh <twaugh at redhat.com>
Date:   Thu Mar 12 11:04:20 2015 +0000

    Correctly report errors when performing USB control transfers (bug #1201048).
    
    Resolves: rhbz#1201048

 libgphoto2-usb-result.patch | 20 ++++++++++++++++++++
 libgphoto2.spec             |  8 +++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)
---
diff --git a/libgphoto2-usb-result.patch b/libgphoto2-usb-result.patch
new file mode 100644
index 0000000..bbbf18a
--- /dev/null
+++ b/libgphoto2-usb-result.patch
@@ -0,0 +1,20 @@
+diff -up libgphoto2-2.5.7/libgphoto2_port/libusb1/libusb1.c.usb-result libgphoto2-2.5.7/libgphoto2_port/libusb1/libusb1.c
+--- libgphoto2-2.5.7/libgphoto2_port/libusb1/libusb1.c.usb-result	2014-12-06 13:09:06.000000000 +0000
++++ libgphoto2-2.5.7/libgphoto2_port/libusb1/libusb1.c	2015-03-12 11:01:26.746472288 +0000
+@@ -545,13 +545,14 @@ gp_port_usb_check_int (GPPort *port, cha
+ static int
+ gp_port_generic_usb_msg(GPPort *port, int request, int value, int index, char *bytes, int size, int flags, int default_error)
+ {
++	int handled;
+ 	C_PARAMS (port && port->pl->dh);
+ 
+-	C_LIBUSB (libusb_control_transfer (port->pl->dh, flags, request, value, index,
++	C_LIBUSB (handled = libusb_control_transfer (port->pl->dh, flags, request, value, index,
+ 			(unsigned char*)bytes, size, port->timeout),
+ 		  default_error);
+ 
+-	return GP_OK;
++	return handled;
+ }
+ 
+ static int
diff --git a/libgphoto2.spec b/libgphoto2.spec
index 07bb396..77baae9 100644
--- a/libgphoto2.spec
+++ b/libgphoto2.spec
@@ -2,7 +2,7 @@
 
 Name:           libgphoto2
 Version:        2.5.7
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Library for accessing digital cameras
 Group:          Development/Libraries
 # GPLV2+ for the main lib (due to exif.c) and most plugins, some plugins GPLv2
@@ -13,6 +13,7 @@ Patch1:         gphoto2-pkgcfg.patch
 Patch2:         gphoto2-storage.patch
 Patch3:         gphoto2-ixany.patch
 Patch4:         gphoto2-device-return.patch
+Patch5:         libgphoto2-usb-result.patch
 BuildRequires:  libusbx-devel
 BuildRequires:  lockdev-devel
 BuildRequires:  libexif-devel
@@ -53,6 +54,7 @@ use libgphoto2.
 %patch2 -p1 -b .storage
 %patch3 -p1 -b .ixany
 %patch4 -p1 -b .device-return
+%patch5 -p1 -b .usb-result
 
 for i in AUTHORS ChangeLog COPYING libgphoto2_port/AUTHORS libgphoto2_port/COPYING.LIB `find -name 'README.*'`; do
     mv ${i} ${i}.old
@@ -142,6 +144,10 @@ rm -rf %{buildroot}%{_defaultdocdir}/%{name}
 %{_mandir}/man3/*
 
 %changelog
+* Thu Mar 12 2015 Tim Waugh <twaugh at redhat.com> 2.5.7-2
+- Apply upstream patch to correctly report errors when performing
+  USB control transfers (bug #1201048).
+
 * Tue Jan 20 2015 Peter Robinson <pbrobinson at fedoraproject.org> 2.5.7-1
 - Update to 2.5.7 for new device support
 


More information about the scm-commits mailing list