From: michael Date: Sun, 1 Apr 2007 14:37:55 +0000 (+0000) Subject: BUGFIX: enable cables not connected to the primary parallel port X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/commitdiff_plain/1f62c14e4f95d8a27377b558676d78ccb9d522c3 BUGFIX: enable cables not connected to the primary parallel port --- diff --git a/usb-driver.c b/usb-driver.c index 209e155..a7d14bf 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -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) { + 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); - parportnum++; 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; - parportnum--; } #endif }