Clear cloexec flag on Dup2

This commit is contained in:
Wildan M
2026-06-20 06:35:01 +07:00
parent ed31b800c4
commit 002fff546d
+2 -1
View File
@@ -1618,7 +1618,8 @@ impl ContextHandle {
let mut context = context.read(token.token());
let (context, mut token) = context.token_split();
let file = context.get_file(old, &mut token).ok_or(Error::new(EBADF))?;
let mut file = context.get_file(old, &mut token).ok_or(Error::new(EBADF))?;
file.cloexec = false;
context
.insert_file(new, file, &mut token)
.ok_or(Error::new(EMFILE))?;