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>
This commit is contained in:
Al Viro 2012-10-08 23:21:58 +01:00 committed by Linus Torvalds
parent f5a246eab9
commit 121977187c
1 changed files with 1 additions and 1 deletions

View File

@ -258,7 +258,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
err = f_dupfd(arg, filp, 0); err = f_dupfd(arg, filp, 0);
break; break;
case F_DUPFD_CLOEXEC: case F_DUPFD_CLOEXEC:
err = f_dupfd(arg, filp, FD_CLOEXEC); err = f_dupfd(arg, filp, O_CLOEXEC);
break; break;
case F_GETFD: case F_GETFD:
err = get_close_on_exec(fd) ? FD_CLOEXEC : 0; err = get_close_on_exec(fd) ? FD_CLOEXEC : 0;