[PATCH v2 14/14] xf86OpenSerial: Add support server managed fds

Hans de Goede hdegoede at redhat.com
Tue Feb 4 12:49:20 CET 2014


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 at redhat.com>
---
 hw/xfree86/os-support/shared/posix_tty.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index 4d08c1e..6e2af00 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",
-- 
1.8.5.3



More information about the xorg-devel mailing list