diff options
-rw-r--r-- | qarshd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -103,7 +103,7 @@ run_cmd(const char *cmd) pid_t pid; int pipefds[2], parentfds[3]; - pipe(pipefds); + pipe2(pipefds, O_NONBLOCK); childfds[0] = pipefds[1]; parentfds[0] = pipefds[0]; /* stdin */ pipe(pipefds); childfds[1] = pipefds[0]; parentfds[1] = pipefds[1]; /* stdout */ @@ -412,7 +412,7 @@ handle_qarsh() memmove(buf_in, buf_in+nbytes, z_in - nbytes); z_in -= nbytes; } - if (!eof_in) { + if (!eof_in && nbytes > 0) { qp = make_qp_data_allow(0, nbytes); send_packet(qoutfd, qp); qpfree(qp); |