]> git.zerfleddert.de Git - usb-driver/commitdiff
BUGFIX: enable cables not connected to the primary parallel port
authormichael <michael>
Sun, 1 Apr 2007 14:37:55 +0000 (14:37 +0000)
committermichael <michael>
Sun, 1 Apr 2007 14:37:55 +0000 (14:37 +0000)
usb-driver.c

index 209e1559cc1effd9c11cd2987c9eb294e2ab024a..a7d14bf5f8a93f05b9d8f53b4c9ab9663c2ab5c7 100644 (file)
@@ -376,10 +376,12 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
                                ret = (*ioctl_func) (fd, request, wdioctl);
 #else
                                if (parportfd < 0) {
                                ret = (*ioctl_func) (fd, request, wdioctl);
 #else
                                if (parportfd < 0) {
+                                       if (ppbase && ((unsigned long)cr->Card.Item[0].I.IO.dwAddr != ppbase))
+                                               parportnum++;
+
                                        snprintf(ppdev, sizeof(ppdev), "/dev/parport%d", parportnum);
                                        DPRINTF("opening %s\n", ppdev);
                                        parportfd = open(ppdev, O_RDWR|O_EXCL);
                                        snprintf(ppdev, sizeof(ppdev), "/dev/parport%d", parportnum);
                                        DPRINTF("opening %s\n", ppdev);
                                        parportfd = open(ppdev, O_RDWR|O_EXCL);
-                                       parportnum++;
 
                                        if (parportfd < 0)
                                                fprintf(stderr,"Can't open %s: %s\n", ppdev, strerror(errno));
 
                                        if (parportfd < 0)
                                                fprintf(stderr,"Can't open %s: %s\n", ppdev, strerror(errno));
@@ -773,7 +775,6 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
                                        ioctl(parportfd, PPRELEASE);
                                        close(parportfd);
                                        parportfd = -1;
                                        ioctl(parportfd, PPRELEASE);
                                        close(parportfd);
                                        parportfd = -1;
-                                       parportnum--;
                                }
 #endif
                        }
                                }
 #endif
                        }
Impressum, Datenschutz