From 055f502c02524b6f271e58e54ffe7e5b61f97fe1 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Fri, 8 Jan 2016 00:36:14 +0100 Subject: [PATCH] Fix dup3(2) O_CLOEXEC and O_CLOFORK handling. --- kernel/io.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/io.cpp b/kernel/io.cpp index 07bc1882..98a6a536 100644 --- a/kernel/io.cpp +++ b/kernel/io.cpp @@ -148,8 +148,8 @@ int sys_dup3(int oldfd, int newfd, int flags) if ( flags & ~(O_CLOEXEC | O_CLOFORK) ) return errno = EINVAL, -1; int fd_flags = 0; - flags |= flags & O_CLOEXEC ? FD_CLOEXEC : 0; - flags |= flags & O_CLOFORK ? FD_CLOFORK : 0; + fd_flags |= flags & O_CLOEXEC ? FD_CLOEXEC : 0; + fd_flags |= flags & O_CLOFORK ? FD_CLOFORK : 0; Ref dtable = CurrentProcess()->GetDTable(); return dtable->Copy(oldfd, newfd, fd_flags); }