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

Alan Coopersmith Alan.Coopersmith at Sun.COM
Thu Mar 11 23:33:09 PST 2010


But other kernels/libc's still don't have it in 2010.   Yes, seriously, 2010.
(Hence the #ifdef I_SETSIG code in there for Solaris & other SysV flavors.)

Delete the Linux libc5 comment, and the first hunk to define O_ASYNC to FSYNC
if you want, but please don't delete the later #ifdefs.

	-alan-

Matt Turner wrote:
> No, seriously. 1998.
> 
> Signed-off-by: Matt Turner <mattst88 at gmail.com>
> ---
>  hw/xfree86/os-support/shared/sigio.c |   12 ------------
>  1 files changed, 0 insertions(+), 12 deletions(-)
> 
> 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) {

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list