[Patch] linux: serial backend find too many ports #1562
Closed
Labels
Milestone
Comments
CUPS.org User: mike Fixed in Subversion repository. I made the code conditional based on the TIOCGSERIAL definition. |
"cups-serial-backend-linux-12rc2.patch": --- cups-1.2rc2/backend/serial.c 2006-03-07 23:07:44.000000000 +0100 include <IOKit/IOBSD.h>#endif /* APPLE */ +#if defined(linux) || defined(linux) || defined(__linux) /*
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: 1.2rc2
CUPS.org User: cryptic
When called without arguments, the serial backend on linux lists all potential serial ports instead of all present serial ports. Many of those ports do not correspond to actual hardware.
This happens because under Linux additional serial port hardware is setup using the device node. So this node needs to be present for any potential port, and serial finds it and lists it.
I fixed this by using an (Linux-specific) ioctl to check whether the serial port was setup, and to skip it if it is not. This only skips ports that are not usable. Ports that do not support the ioctl (i.e. are always setup/present) are listed as before.
Please (feel free to) apply!
Patch is against 1.2rc2
The text was updated successfully, but these errors were encountered: