diff options
Diffstat (limited to 'qarsh.c')
-rw-r--r-- | qarsh.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -292,13 +292,7 @@ run_remote_cmd(char *cmdline) &pselect_sigmask); if (nset == 0) { - if (cmd_finished && c_out == 0 && c_err == 0) { - /* If the command is complete and both output - * sockets are closed, we can exit now. We need - * to test all conditions at once so if none are - * true, we'll still check for heartbeat. */ - break; - } else if (!hbeat(qarsh_hb)) { + if (!hbeat(qarsh_hb)) { /* If the heartbeat fails, we should exit now. * The hbeat state will take precedence over the * exit status of the command. */ @@ -384,6 +378,13 @@ run_remote_cmd(char *cmdline) nset--; } } + if (cmd_finished && c_out == 0 && c_err == 0) { + /* If the command is complete and both output + * sockets are closed, we can exit now. We need + * to test all conditions at once so if none are + * true, we'll still check for heartbeat. */ + break; + } } if (c_out) close(c_out); if (c_err) close(c_err); |