X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/blobdiff_plain/332ced7a9ce8669a2986d64547fd13615152555d..b72b86b42ae1c4139170de1fa98748feef11ed89:/usb-driver.c diff --git a/usb-driver.c b/usb-driver.c index a6d64ce..a3a2efb 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "usb-driver.h" static int (*ioctl_func) (int, int, void *) = NULL; @@ -51,7 +52,7 @@ static int ints_enabled = 0; static pthread_mutex_t int_wait = PTHREAD_MUTEX_INITIALIZER; #define NO_WINDRVR 1 -#undef DEBUG +/* #define DEBUG 1 */ #ifdef DEBUG #define DPRINTF(format, args...) fprintf(stderr, format, ##args) @@ -710,7 +711,7 @@ int close(int fd) { if (!func) func = (int (*) (int)) dlsym(RTLD_NEXT, "close"); - if (fd == windrvrfd) { + if (fd == windrvrfd && windrvrfd >= 0) { DPRINTF("close windrvrfd\n"); windrvrfd = -1; }