Commit f1b0b2be authored by Geoff Simmons's avatar Geoff Simmons

Don't close stdin prematurely.

parent 7807c7c6
...@@ -462,12 +462,11 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -462,12 +462,11 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
} }
} }
if (act == VDP_END) { if (act == VDP_END) {
if (fds[STDIN_FILENO].fd != -1) if (fds[STDIN_FILENO].fd != -1 && len == 0)
closefd(&fds[STDIN_FILENO].fd); closefd(&fds[STDIN_FILENO].fd);
if (fds[STDOUT_FILENO].fd != -1 || if (fds[STDOUT_FILENO].fd != -1 ||
fds[STDERR_FILENO].fd != -1) fds[STDERR_FILENO].fd != -1)
continue; continue;
break;
} }
if (len == 0) if (len == 0)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment