[PATCH] Don't bother checking for O_ASYNC, glibc's had it since '98.

Mark Kettenis mark.kettenis at xs4all.nl
Fri Mar 12 01:32:09 PST 2010


> From: Matt Turner <mattst88 at gmail.com>
> Date: Fri, 12 Mar 2010 01:50:46 -0500
> 
> No, seriously. 1998.

No problems with dropping that Linux libc5 bit, but O_ASYNC isn't
defined by POSIX, so I think the #ifdef O_ASYNC bits will have to
stay.

> diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
> index aed5654..88f1d49 100644
> --- a/hw/xfree86/os-support/shared/sigio.c
> +++ b/hw/xfree86/os-support/shared/sigio.c
> @@ -67,14 +67,6 @@
>  # include <stropts.h>
>  #endif
>  
> -/*
> - * Linux libc5 defines FASYNC, but not O_ASYNC.  Don't know if it is
> - * functional or not.
> - */
> -#if defined(FASYNC) && !defined(O_ASYNC)
> -#  define O_ASYNC FASYNC
> -#endif
> -
>  #ifdef MAXDEVICES
>  /* MAXDEVICES represents the maximimum number of input devices usable
>   * at the same time plus one entry for DRM support.
> @@ -155,7 +147,6 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
>  	    if (xf86IsPipe (fd))
>  		return 0;
>  	    blocked = xf86BlockSIGIO();
> -#ifdef O_ASYNC
>  	    if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
>  		xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
>  			fd, strerror(errno));
> @@ -167,7 +158,6 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
>  		    installed = TRUE;
>  		}
>  	    }
> -#endif
>  #ifdef I_SETSIG /* System V Streams - used on Solaris for input devices */
>  	    if (!installed && isastream(fd)) {
>  		if (ioctl(fd, I_SETSIG, S_INPUT | S_ERROR | S_HANGUP) == -1) {
> @@ -247,9 +237,7 @@ xf86RemoveSIGIOHandler(int fd)
>      }
>      if (ret)
>      {
> -#ifdef O_ASYNC
>  	fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_ASYNC);
> -#endif
>  #ifdef I_SETSIG
>  	if (isastream(fd)) {
>  	    if (ioctl(fd, I_SETSIG, 0) == -1) {
> -- 
> 1.6.4.4
> 
> _______________________________________________
> 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