mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 23:42:32 +00:00
libc: Handle dup2 with two equal arguments
This commit is contained in:
parent
fbd4b5f6df
commit
1009d00168
@ -340,6 +340,9 @@ extern "C" int _dup2(int libc_fd, int new_libc_fd)
|
||||
if (!fd || !fd->plugin)
|
||||
return INVALID_FD;
|
||||
|
||||
if (libc_fd == new_libc_fd)
|
||||
return libc_fd;
|
||||
|
||||
/*
|
||||
* Check if 'new_libc_fd' is already in use. If so, close it before
|
||||
* allocating it again.
|
||||
|
Loading…
Reference in New Issue
Block a user