diff options
author | Nate Straz <nstraz@redhat.com> | 2008-08-07 22:13:25 +0000 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2008-09-23 09:37:47 -0400 |
commit | 185eb227d83cde62c64b5d63af5f2a63469274bd (patch) | |
tree | 62ac6943b2c5fe112ade337a8bcab235d9606679 | |
parent | 7af9afb54119d9afd23945f5ef92915454aeba2e (diff) | |
download | qarsh-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.
-rw-r--r-- | qarsh.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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) { |