summaryrefslogtreecommitdiffstats
path: root/qarsh.c
diff options
context:
space:
mode:
authorNate Straz <nstraz@redhat.com>2008-08-07 22:13:25 +0000
committerNathan Straz <nstraz@redhat.com>2008-09-23 09:37:47 -0400
commit185eb227d83cde62c64b5d63af5f2a63469274bd (patch)
tree62ac6943b2c5fe112ade337a8bcab235d9606679 /qarsh.c
parent7af9afb54119d9afd23945f5ef92915454aeba2e (diff)
downloadqarsh-185eb227d83cde62c64b5d63af5f2a63469274bd.tar.gz
qarsh-185eb227d83cde62c64b5d63af5f2a63469274bd.tar.xz
qarsh-185eb227d83cde62c64b5d63af5f2a63469274bd.zip
Bob found a problem with commands that exit quickly, the pselect times out so
quickly that we do a hbeat then go back to the pselect.
Diffstat (limited to 'qarsh.c')
-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) {