mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix dup3(2) O_CLOEXEC and O_CLOFORK handling.
This commit is contained in:
parent
ee9ec2eda1
commit
055f502c02
1 changed files with 2 additions and 2 deletions
|
@ -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<DescriptorTable> dtable = CurrentProcess()->GetDTable();
|
||||
return dtable->Copy(oldfd, newfd, fd_flags);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue