Skip to content

Commit 1219771

Browse files
Al Virotorvalds
Al Viro
authored andcommitted
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 <[email protected]> Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f5a246e commit 1219771

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fcntl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
258258
err = f_dupfd(arg, filp, 0);
259259
break;
260260
case F_DUPFD_CLOEXEC:
261-
err = f_dupfd(arg, filp, FD_CLOEXEC);
261+
err = f_dupfd(arg, filp, O_CLOEXEC);
262262
break;
263263
case F_GETFD:
264264
err = get_close_on_exec(fd) ? FD_CLOEXEC : 0;

0 commit comments

Comments
 (0)