* [PATCH] 2.6.20-rc4: force fcntl(..., FASYNC) to return -EINVAL when f_op->fasync is NULL
@ 2007-01-12 9:46 Dmitry Antipov
0 siblings, 0 replies; only message in thread
From: Dmitry Antipov @ 2007-01-12 9:46 UTC (permalink / raw)
To: linux-kernel
Hello,
this is a proposal fix needed to receive an error when the user requests
'fcntl(fd, F_SETFL, FASYNC)' but lower levels are too poor to handle this.
Dmitry
--- .orig-2.6.20-rc4/fs/fcntl.c 2007-01-12 08:27:10.000000000 +0300
+++ 2.6.20-rc4/fs/fcntl.c 2007-01-12 09:56:14.000000000 +0300
@@ -236,11 +236,11 @@
lock_kernel();
if ((arg ^ filp->f_flags) & FASYNC) {
- if (filp->f_op && filp->f_op->fasync) {
+ error = -EINVAL;
+ if (filp->f_op && filp->f_op->fasync)
error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
- if (error < 0)
- goto out;
- }
+ if (error < 0)
+ goto out;
}
filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-01-12 9:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-12 9:46 [PATCH] 2.6.20-rc4: force fcntl(..., FASYNC) to return -EINVAL when f_op->fasync is NULL Dmitry Antipov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.