Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Patch] linux: serial backend find too many ports #1562
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
--- cups-1.2rc2/backend/serial.c 2006-03-07 23:07:44.000000000 +0100
#endif /* APPLE */
+#if defined(linux) || defined(linux) || defined(__linux)