[close]
Attachments you submit will be routed for moderation. If you have an account, please
log in first.
Ticket #117: 0089-conversative-partial-fix-for-ticket-117.patch
| File 0089-conversative-partial-fix-for-ticket-117.patch,
2.0 KB
(added by rogueresearch, 20 months ago) |
|
newer patch
|
-
From 057666ce7d12ec79c6972d17f8b138648ead11a5 Mon Sep 17 00:00:00 2001
From: Sean McBride <sean@rogue-research.com>
Date: Fri, 16 Sep 2011 15:06:36 -0400
Subject: [PATCH 89/89] conversative partial fix for ticket #117
---
libusb/os/darwin_usb.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index b82c8dc..7636b30 100644
|
a
|
b
|
static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) |
| 1529 | 1529 | struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); |
| 1530 | 1530 | struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; |
| 1531 | 1531 | UInt32 message; |
| | 1532 | UInt32 size = (UInt32) arg0; /* TODO: shouldn't truncate like this. */ |
| 1532 | 1533 | |
| 1533 | 1534 | usbi_info (ITRANSFER_CTX (itransfer), "an async io operation has completed"); |
| 1534 | 1535 | |
| … |
… |
static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) |
| 1536 | 1537 | message = MESSAGE_ASYNC_IO_COMPLETE; |
| 1537 | 1538 | write (priv->fds[1], &message, sizeof (message)); |
| 1538 | 1539 | write (priv->fds[1], &itransfer, sizeof (itransfer)); |
| 1539 | | write (priv->fds[1], &result, sizeof (IOReturn)); |
| 1540 | | write (priv->fds[1], &arg0, sizeof (UInt32)); |
| | 1540 | write (priv->fds[1], &result, sizeof (result)); |
| | 1541 | write (priv->fds[1], &size, sizeof (size)); |
| 1541 | 1542 | } |
| 1542 | 1543 | |
| 1543 | 1544 | static int darwin_transfer_status (struct usbi_transfer *itransfer, kern_return_t result) { |
| … |
… |
static int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL |
| 1650 | 1651 | continue; |
| 1651 | 1652 | case MESSAGE_ASYNC_IO_COMPLETE: |
| 1652 | 1653 | read (hpriv->fds[0], &itransfer, sizeof (itransfer)); |
| 1653 | | read (hpriv->fds[0], &kresult, sizeof (IOReturn)); |
| 1654 | | read (hpriv->fds[0], &io_size, sizeof (UInt32)); |
| | 1654 | read (hpriv->fds[0], &kresult, sizeof (kresult)); |
| | 1655 | read (hpriv->fds[0], &io_size, sizeof (io_size)); |
| 1655 | 1656 | |
| 1656 | 1657 | darwin_handle_callback (itransfer, kresult, io_size); |
| 1657 | 1658 | break; |
Download in other formats: