diff options
author | Daniel Drake <dsd@gentoo.org> | 2008-04-27 23:27:04 +0100 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2008-04-29 12:08:35 +0100 |
commit | 7ac0a405b4c57db42e88cbcba5f135697f03b646 (patch) | |
tree | 464387a50ab952d388a05a234c7d0c962eda2023 /libusb/sync.c | |
parent | a5006fd7b9dae6f1db7969c8744086ba3a7c027b (diff) | |
download | libusb-7ac0a405b4c57db42e88cbcba5f135697f03b646.tar.gz |
Remove libusb_cancel_transfer_sync
This wasn't a particularly nice API. Cancellation should be handled by
the completion handler.
Diffstat (limited to 'libusb/sync.c')
-rw-r--r-- | libusb/sync.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libusb/sync.c b/libusb/sync.c index e7d7369..3cfd013 100644 --- a/libusb/sync.c +++ b/libusb/sync.c @@ -96,7 +96,10 @@ API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle, while (!completed) { r = libusb_handle_events(); if (r < 0) { - libusb_cancel_transfer_sync(transfer); + libusb_cancel_transfer(transfer); + while (!completed) + if (libusb_handle_events() < 0) + break; libusb_free_transfer(transfer); return r; } @@ -154,7 +157,10 @@ static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle, while (!completed) { r = libusb_handle_events(); if (r < 0) { - libusb_cancel_transfer_sync(transfer); + libusb_cancel_transfer(transfer); + while (!completed) + if (libusb_handle_events() < 0) + break; libusb_free_transfer(transfer); return r; } |