summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2006-05-04 05:31:34 +0000
committerLinus Walleij <triad@df.lth.se>2006-05-04 05:31:34 +0000
commit0ed2a9f807f89395e525338f5c3c412185e9919a (patch)
treef539bbee1b533d380b64536ca9d78cbe95654c96
parent62f7a4f41472d11f39b88bcdf1825719701bc7e8 (diff)
downloadlibmtp-0ed2a9f807f89395e525338f5c3c412185e9919a.tar.gz
Patches and fixes.
-rw-r--r--README10
-rw-r--r--src/libusb-glue.c10
2 files changed, 16 insertions, 4 deletions
diff --git a/README b/README
index 8b07f2c..7d20828 100644
--- a/README
+++ b/README
@@ -20,3 +20,13 @@ from programs with the following limitations/conditions:
- Files should be stored in the folder "My Organizer" when
sent to the device (Use the option -f "My Organizer" to
sendfile for this)
+
+
+libgphoto2 heritage:
+--------------------
+
+libmtp is based on libgphoto2, in practice this means we
+use ptp.c, ptp.h and ptp-pack.c verbatim from the libgphoto2
+source code. If you need to change things in these files,
+make sure it is so general that libgphoto2 will want to
+merge it to their codebase too.
diff --git a/src/libusb-glue.c b/src/libusb-glue.c
index 7eb5a3f..5a94cb7 100644
--- a/src/libusb-glue.c
+++ b/src/libusb-glue.c
@@ -211,14 +211,16 @@ static void init_ptp_usb (PTPParams* params, PTP_USB* ptp_usb, struct usb_device
params->transaction_id=0;
params->byteorder = PTP_DL_LE;
- if ((device_handle=usb_open(dev))){
+ if ((device_handle = usb_open(dev))){
if (!device_handle) {
perror("usb_open()");
exit(0);
}
- ptp_usb->handle=device_handle;
- usb_claim_interface(device_handle,
- dev->config->interface->altsetting->bInterfaceNumber);
+ ptp_usb->handle = device_handle;
+ if (!usb_claim_interface(device_handle, dev->config->interface->altsetting->bInterfaceNumber)) {
+ perror("usb_claim_interface()");
+ exit(0);
+ }
}
}