summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qarsh.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/qarsh.c b/qarsh.c
index fb09076..63ff213 100644
--- a/qarsh.c
+++ b/qarsh.c
@@ -292,16 +292,20 @@ run_remote_cmd(char *cmdline)
&pselect_sigmask);
if (nset == 0) {
- if (cmd_finished && c_out == 0 && c_err == 0) break;
-
- if (!hbeat(qarsh_hb)) {
+ if (cmd_finished) {
+ /* we don't want to check the heartbeat, just
+ * the output sockets */
+ if (c_out == 0 && c_err == 0) break;
+ } else if (!hbeat(qarsh_hb)) {
/* Set our return packet as NULL so we exit
* with unknown error. */
qp = NULL;
break;
- }
-
- continue;
+ } else {
+ /* No output to process, the command is
+ * still running, and the host is still up */
+ continue;
+ }
}
if (nset == -1 && errno == EINTR) {