]> git.zerfleddert.de Git - usb-driver/blobdiff - usb-driver.c
only close the parallel port when it was really openend
[usb-driver] / usb-driver.c
index d90952258c070961ca428af69ae90b93b414bbd5..e6201459046d9f6c8f671f741896472cbf020742 100644 (file)
@@ -636,7 +636,10 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
 #ifndef NO_WINDRVR
                                ret = (*ioctl_func) (fd, request, wdioctl);
 #else
-                               pport->close(cr->hCard);
+                               if (pport)
+                                       pport->close(cr->hCard);
+
+                               pport = NULL;
 #endif
                        }
                        break;
@@ -890,8 +893,8 @@ int access(const char *pathname, int mode) {
 
        if (!func)
                func = (int (*) (const char*, int)) dlsym(RTLD_NEXT, "access");
-       
-       if (!strcmp(pathname, "/dev/windrvr6")) {
+
+       if (pathname && !strcmp(pathname, "/dev/windrvr6")) {
                return 0;
        } else {
                return (*func)(pathname, mode);
Impressum, Datenschutz