patch-2.2.5 linux/fs/ioctl.c

Next file: linux/fs/lockd/svcsubs.c
Previous file: linux/fs/buffer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.4/linux/fs/ioctl.c linux/fs/ioctl.c
@@ -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:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)