aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2012-10-08 18:21:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 02:52:31 -0400
commit121977187ca0a7f20b848530deb04cc56167769b (patch)
treebe4fc44f5aff4fe226e371959f3734db5bf4427e /fs
parentf5a246eab9a268f51ba8189ea5b098a1bfff200e (diff)
Fix F_DUPFD_CLOEXEC breakage
Fix a braino in F_DUPFD_CLOEXEC; f_dupfd() expects flags for alloc_fd(), get_unused_fd() etc and there clone-on-exec if O_CLOEXEC, not FD_CLOEXEC. Reported-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fcntl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 8f704291d4ed..71a600a19f06 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -258,7 +258,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
258 err = f_dupfd(arg, filp, 0); 258 err = f_dupfd(arg, filp, 0);
259 break; 259 break;
260 case F_DUPFD_CLOEXEC: 260 case F_DUPFD_CLOEXEC:
261 err = f_dupfd(arg, filp, FD_CLOEXEC); 261 err = f_dupfd(arg, filp, O_CLOEXEC);
262 break; 262 break;
263 case F_GETFD: 263 case F_GETFD:
264 err = get_close_on_exec(fd) ? FD_CLOEXEC : 0; 264 err = get_close_on_exec(fd) ? FD_CLOEXEC : 0;