summaryrefslogtreecommitdiffstats
path: root/qarshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'qarshd.c')
-rw-r--r--qarshd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/qarshd.c b/qarshd.c
index 2bb6509..093e001 100644
--- a/qarshd.c
+++ b/qarshd.c
@@ -299,6 +299,8 @@ handle_qarsh()
for (;;) {
+ timeout.tv_sec = 3;
+ timeout.tv_nsec = 0;
FD_ZERO(&rfds); FD_ZERO(&wfds);
FD_SET(qinfd, &rfds);
maxfd = qinfd;
@@ -314,6 +316,7 @@ handle_qarsh()
FD_SET(childfds[2], &rfds);
maxfd = childfds[2] > maxfd ? childfds[2] : maxfd;
}
+
nfd = pselect(maxfd+1, &rfds, &wfds, NULL, &timeout, &orig_sigmask);
if (child_exitted) {
@@ -379,6 +382,7 @@ handle_qarsh()
break;
}
nfd--;
+ qpfree(qp);
}
if (nfd && FD_ISSET(childfds[0], &wfds)) {
/* Child is ready for data on stdin */
@@ -487,6 +491,7 @@ handle_packets()
child_pid = run_cmd(qp->qp_runcmd.qp_cmdline);
qpfree(qp);
handle_qarsh(); /* continue processing qarsh separately */
+ return;
break;
case QP_RECVFILE: /* Setup file descriptors to handle incoming data */
rp = prepare_recvfile(qp);