Windows: Don't leak pipe fds
authorPete Batard <pbatard@gmail.com>
Tue, 8 Mar 2011 17:37:40 +0000 (17:37 +0000)
committerPeter Stuge <peter@stuge.se>
Mon, 13 Jun 2011 20:06:31 +0000 (22:06 +0200)
commit25fa63ea1cfe02e784cb62d3b869fd15e62b5b6e
tree28fd963cac2258f1644d5a416aa45171c840a104
parent3ccd9bddec316ee4b867959fd7f616eb4d410997
Windows: Don't leak pipe fds

use _open() and _close() rather than _open_osfhandle() and CloseHandle()

* use of CloseHandle() prevented the pipe fds from being
  relinquished on libusb_exit()
* leaked fds could lead to the OS running out of new fds
  and LIBUSB_ERROR_NO_MEM being returned as a result
* using _open() avoids _open_osfhandle() redef for cygwin
* issue reported by Stephano Antonelli
libusb/os/poll_windows.c
libusb/os/poll_windows.h