[patch] FIOASYNC

Godmar Back (gback@cs.utah.edu)
Wed, 10 Mar 1999 10:33:20 -0700 (MST)


The following patch for fs/ioctl.c should fix the misinterpretation of
FIOASYNC in 2.2.3 and earlier kernels.

- Godmar

--- ioctl.c.2.2.3 Wed Mar 10 10:14:03 1999
+++ ioctl.c Wed Mar 10 10:27:49 1999
@@ -74,14 +74,20 @@
filp->f_flags &= ~flag;
break;

- case FIOASYNC: /* O_SYNC is not yet implemented,
- but it's here for completeness. */
+ case FIOASYNC:
if ((error = get_user(on, (int *)arg)) != 0)
break;
+ flag = on ? FASYNC : 0;
+
+ /* Did FASYNC state change ? */
+ if ((flag ^ filp->f_flags) & FASYNC) {
+ if (filp->f_op && filp->f_op->fasync)
+ filp->f_op->fasync(fd, filp, on);
+ }
if (on)
- filp->f_flags |= O_SYNC;
+ filp->f_flags |= FASYNC;
else
- filp->f_flags &= ~O_SYNC;
+ filp->f_flags &= ~FASYNC;
break;

default:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/