xf86OpenSerial: Add support server managed fds

Try to get a server managed fd from the Options before trying to open the
device node ourselves.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Hans de Goede 2014-02-01 13:21:15 +01:00
parent d9a4059d40
commit bf3543739d

View File

@ -124,7 +124,11 @@ xf86OpenSerial(XF86OptionPtr options)
return -1;
}
SYSCALL(fd = open(dev, O_RDWR | O_NONBLOCK));
fd = xf86CheckIntOption(options, "fd", -1);
if (fd == -1)
SYSCALL(fd = open(dev, O_RDWR | O_NONBLOCK));
if (fd == -1) {
xf86Msg(X_ERROR,
"xf86OpenSerial: Cannot open device %s\n\t%s.\n",