lkml.org 
[lkml]   [2000]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Async I/O Should Fail on non-asyncable
Date
The current FIOASYNC code is wrong: Solaris and HP/UX return error for
FIOASYNC on unsupported devices (eg. files, named pipes). Also, if
the fasync strategy fails (eg. ENOMEM from a tty), things can break
badly.

2.3.x patch: applies to 2.2 as well.

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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.040 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site