diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2015-03-27 07:05:41 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2015-03-27 07:05:41 +0000 |
commit | 6d522fb5285c08679cffd2f1147e616dd8de4c4d (patch) | |
tree | 7b8815dd459aeabb8c30f4cef52f6e32203c257d /libgphoto2_port/libusb1 | |
parent | 1defddc66f749ddffcc49675fe3f56a0a1f0a3ec (diff) | |
download | libgphoto2-6d522fb5285c08679cffd2f1147e616dd8de4c4d.tar.gz |
From: Axel Waggershauser <awagger@web.de>
1) I always got an "invalid parameter" error message on gp_camera_exit,
because gp_port_close gets called twice. Since the result gets ignored
anyway the attached patch makes libusb1.c accept a second call by simply
returning.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15403 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/libusb1')
-rw-r--r-- | libgphoto2_port/libusb1/libusb1.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgphoto2_port/libusb1/libusb1.c b/libgphoto2_port/libusb1/libusb1.c index 2faf3076d..94094977b 100644 --- a/libgphoto2_port/libusb1/libusb1.c +++ b/libgphoto2_port/libusb1/libusb1.c @@ -434,7 +434,10 @@ gp_libusb1_open (GPPort *port) static int gp_libusb1_close (GPPort *port) { - C_PARAMS (port && port->pl->dh); + C_PARAMS (port); + + if (port->pl->dh == NULL) + return GP_OK; if (libusb_release_interface (port->pl->dh, port->settings.usb.interface) < 0) { |