mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-01 21:36:09 +00:00
Close fds explicitly
This commit is contained in:
parent
ced282c06c
commit
6131f4cba7
1 changed files with 4 additions and 1 deletions
|
|
@ -136,7 +136,10 @@ spawn(PyObject *self UNUSED, PyObject *args) {
|
|||
int fd = PyLong_AsLong(pfd);
|
||||
if (fd > -1) {
|
||||
if (fd == min_closed_fd) min_closed_fd++;
|
||||
else if (safe_dup2(fd, min_closed_fd++) == -1) exit_on_err("dup2() failed for forwarded fd 1");
|
||||
else {
|
||||
if (safe_dup2(fd, min_closed_fd++) == -1) exit_on_err("dup2() failed for forwarded fd 1");
|
||||
safe_close(fd, __FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (forward_stdio) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue