[PATCH] Async I/O should indicate failure.

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Sat Apr 08 2000 - 08:44:41 EST


Solaris and HP/UX don't allow FIOASYNC on unsupported devices. I
assume ENOTTY is correct here; I don't have a spec.

Also, if the fasync strategy fails (eg. ENOMEM from a tty), the flag
gets set, and the user remains unaware of failure.

Rusty.
--- linux-2.3/fs/ioctl.c.~1~ Tue Nov 30 17:57:44 1999
+++ linux-2.3/fs/ioctl.c Tue Dec 21 14:10:54 1999
@@ -91,8 +91,12 @@
                         /* 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);
+ error = filp->f_op->fasync(fd, filp, on);
+ else error = -ENOTTY;
                         }
+ if (error != 0)
+ break;
+
                         if (on)
                                 filp->f_flags |= FASYNC;
                         else

--
Hacking time.

- 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/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:24 EST