mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-102179: Fix os.dup2
error reporting for negative fds (#102180)
This commit is contained in:
parent
705487c655
commit
c2bd55d26f
3 changed files with 21 additions and 5 deletions
|
@ -9795,11 +9795,6 @@ os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable)
|
|||
static int dup3_works = -1;
|
||||
#endif
|
||||
|
||||
if (fd < 0 || fd2 < 0) {
|
||||
posix_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* dup2() can fail with EINTR if the target FD is already open, because it
|
||||
* then has to be closed. See os_close_impl() for why we don't handle EINTR
|
||||
* upon close(), and therefore below.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue