Commit 12197718 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

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
Reported-by: default avatarRichard W.M. Jones <>
Signed-off-by: default avatarAl Viro <>
Signed-off-by: default avatarLinus Torvalds <>
parent f5a246ea
......@@ -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, FD_CLOEXEC);
err = f_dupfd(arg, filp, O_CLOEXEC);
case F_GETFD:
err = get_close_on_exec(fd) ? FD_CLOEXEC : 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment