We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ced282c commit 6131f4cCopy full SHA for 6131f4c
kitty/child.c
@@ -136,7 +136,10 @@ spawn(PyObject *self UNUSED, PyObject *args) {
136
int fd = PyLong_AsLong(pfd);
137
if (fd > -1) {
138
if (fd == min_closed_fd) min_closed_fd++;
139
- else if (safe_dup2(fd, min_closed_fd++) == -1) exit_on_err("dup2() failed for forwarded fd 1");
+ else {
140
+ if (safe_dup2(fd, min_closed_fd++) == -1) exit_on_err("dup2() failed for forwarded fd 1");
141
+ safe_close(fd, __FILE__, __LINE__);
142
+ }
143
}
144
145
if (forward_stdio) {
0 commit comments