lol

Merge #196146: android-tools: fix build against 6.0 kernel headers

Fixes #197430

+83
+82
pkgs/tools/misc/android-tools/android-tools-kernel-headers-6.0.diff
··· 1 + diff --git a/vendor/adb/client/usb_linux.cpp b/vendor/adb/client/usb_linux.cpp 2 + index 25a50bd..0d09c47 100644 3 + --- a/vendor/adb/client/usb_linux.cpp 4 + +++ b/vendor/adb/client/usb_linux.cpp 5 + @@ -59,8 +59,15 @@ using namespace std::literals; 6 + #define DBGX(x...) 7 + 8 + struct usb_handle { 9 + + usb_handle() : urb_in(0), urb_out(0) { 10 + + this->urb_in = new usbdevfs_urb; 11 + + this->urb_out = new usbdevfs_urb; 12 + + } 13 + + 14 + ~usb_handle() { 15 + if (fd != -1) unix_close(fd); 16 + + delete urb_in; 17 + + delete urb_out; 18 + } 19 + 20 + std::string path; 21 + @@ -72,8 +79,8 @@ struct usb_handle { 22 + unsigned zero_mask; 23 + unsigned writeable = 1; 24 + 25 + - usbdevfs_urb urb_in; 26 + - usbdevfs_urb urb_out; 27 + + usbdevfs_urb *urb_in; 28 + + usbdevfs_urb *urb_out; 29 + 30 + bool urb_in_busy = false; 31 + bool urb_out_busy = false; 32 + @@ -304,7 +311,7 @@ static int usb_bulk_write(usb_handle* h, const void* data, int len) { 33 + std::unique_lock<std::mutex> lock(h->mutex); 34 + D("++ usb_bulk_write ++"); 35 + 36 + - usbdevfs_urb* urb = &h->urb_out; 37 + + usbdevfs_urb* urb = h->urb_out; 38 + memset(urb, 0, sizeof(*urb)); 39 + urb->type = USBDEVFS_URB_TYPE_BULK; 40 + urb->endpoint = h->ep_out; 41 + @@ -343,7 +350,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) { 42 + std::unique_lock<std::mutex> lock(h->mutex); 43 + D("++ usb_bulk_read ++"); 44 + 45 + - usbdevfs_urb* urb = &h->urb_in; 46 + + usbdevfs_urb* urb = h->urb_in; 47 + memset(urb, 0, sizeof(*urb)); 48 + urb->type = USBDEVFS_URB_TYPE_BULK; 49 + urb->endpoint = h->ep_in; 50 + @@ -388,7 +395,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) { 51 + } 52 + D("[ urb @%p status = %d, actual = %d ]", out, out->status, out->actual_length); 53 + 54 + - if (out == &h->urb_in) { 55 + + if (out == h->urb_in) { 56 + D("[ reap urb - IN complete ]"); 57 + h->urb_in_busy = false; 58 + if (urb->status != 0) { 59 + @@ -397,7 +404,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) { 60 + } 61 + return urb->actual_length; 62 + } 63 + - if (out == &h->urb_out) { 64 + + if (out == h->urb_out) { 65 + D("[ reap urb - OUT compelete ]"); 66 + h->urb_out_busy = false; 67 + h->cv.notify_all(); 68 + @@ -501,10 +508,10 @@ void usb_kick(usb_handle* h) { 69 + ** but this ensures that a reader blocked on REAPURB 70 + ** will get unblocked 71 + */ 72 + - ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_in); 73 + - ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_out); 74 + - h->urb_in.status = -ENODEV; 75 + - h->urb_out.status = -ENODEV; 76 + + ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_in); 77 + + ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_out); 78 + + h->urb_in->status = -ENODEV; 79 + + h->urb_out->status = -ENODEV; 80 + h->urb_in_busy = false; 81 + h->urb_out_busy = false; 82 + h->cv.notify_all();
+1
pkgs/tools/misc/android-tools/default.nix
··· 25 25 revert = true; 26 26 excludes = [ "vendor/fmtlib" ]; 27 27 }) 28 + ./android-tools-kernel-headers-6.0.diff 28 29 ]; 29 30 30 31 nativeBuildInputs = [ cmake perl go ];