diff options
Diffstat (limited to 'hw/xfree86/os-support/shared/posix_tty.c')
-rw-r--r-- | hw/xfree86/os-support/shared/posix_tty.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c index 4d08c1e85..6e2af001a 100644 --- a/hw/xfree86/os-support/shared/posix_tty.c +++ b/hw/xfree86/os-support/shared/posix_tty.c @@ -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", |