mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Kernel: Make dup2() return the fd even if old & new are the same (#7506)
This commit is contained in:
parent
97d0ebba20
commit
58bc10b947
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ KResultOr<int> Process::sys$dup2(int old_fd, int new_fd)
|
|||
if (!description)
|
||||
return EBADF;
|
||||
if (old_fd == new_fd)
|
||||
return 0;
|
||||
return new_fd;
|
||||
if (new_fd < 0 || new_fd >= m_max_open_file_descriptors)
|
||||
return EINVAL;
|
||||
m_fds[new_fd].set(*description);
|
||||
|
|
Loading…
Add table
Reference in a new issue