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

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 11 06:54:44 CET 2014


On Tue, Feb 04, 2014 at 12:49:20PM +0100, Hans de Goede wrote:
> 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>


Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
   Peter


> ---
>  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
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list