[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, 3 years ago)

newer patch

  • libusb/os/darwin_usb.c

    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) 
    15291529  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); 
    15301530  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; 
    15311531  UInt32 message; 
     1532  UInt32 size = (UInt32) arg0; /* TODO: shouldn't truncate like this. */ 
    15321533 
    15331534  usbi_info (ITRANSFER_CTX (itransfer), "an async io operation has completed"); 
    15341535 
    static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) 
    15361537  message = MESSAGE_ASYNC_IO_COMPLETE; 
    15371538  write (priv->fds[1], &message, sizeof (message)); 
    15381539  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)); 
    15411542} 
    15421543 
    15431544static 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 
    16501651      continue; 
    16511652    case MESSAGE_ASYNC_IO_COMPLETE: 
    16521653      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)); 
    16551656 
    16561657      darwin_handle_callback (itransfer, kresult, io_size); 
    16571658      break;