MacOS: Silence pipe error in set_interface_alt_setting()
authorFreek Dijkstra <freek@macfreek.nl>
Mon, 11 Jan 2021 00:49:42 +0000 (01:49 +0100)
committerNathan Hjelm <hjelmn@google.com>
Wed, 13 Jan 2021 22:57:15 +0000 (15:57 -0700)
commitbf943bce82293a304d71807081233257ff8b955b
treede51bd713ba9f6b5411075bfa13fee799f4c6d6a
parent073f229fd11f0d3e3098af44e59b5607aae113e2
MacOS: Silence pipe error in set_interface_alt_setting()

darwin_set_interface_altsetting() no longer returns the status of the underlying SetAlternateInterface(), but instead the result of a subsequent GetNumEndpoints() call. This reverts to the behaviour prior to commit 065e586.

Since darwin_set_interface_altsetting() resets the interface after SetAlternateInterface(), one of the consequences is that if SetAlternateInterface() returns a kIOUSBPipeStalled error, and the interface is successfully reset, darwin_set_interface_altsetting() now returns LIBUSB_SUCCESS instead of LIBUSB_ERROR_PIPE.

Closes: #838

Signed-off-by: Freek Dijkstra
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/os/darwin_usb.c
libusb/version_nano.h