summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-12-17 16:31:53 +1100
committerDamien Miller <djm@mindrot.org>2003-12-17 16:31:53 +1100
commitd696551443ff947cb6e3e690adcecd17877f16ea (patch)
tree0c9095bde5d3b593f7328cb5964973b7f545020b /clientloop.c
parent12c150e7e0711e29ea5dc78d3c9ed46221319dc5 (diff)
- dtucker@cvs.openbsd.org 2003/12/09 23:45:32
[clientloop.c] Clear exit code when ssh -N is terminated with a SIGTERM. ok markus@
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/clientloop.c b/clientloop.c
index e7a7d9fa7..67b9dfcea 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.115 2003/09/23 20:41:11 markus Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.116 2003/12/09 23:45:32 dtucker Exp $");
63 63
64#include "ssh.h" 64#include "ssh.h"
65#include "ssh1.h" 65#include "ssh1.h"
@@ -89,6 +89,9 @@ extern Options options;
89/* Flag indicating that stdin should be redirected from /dev/null. */ 89/* Flag indicating that stdin should be redirected from /dev/null. */
90extern int stdin_null_flag; 90extern int stdin_null_flag;
91 91
92/* Flag indicating that no shell has been requested */
93extern int no_shell_flag;
94
92/* 95/*
93 * Name of the host we are connecting to. This is the name given on the 96 * Name of the host we are connecting to. This is the name given on the
94 * command line, or the HostName specified for the user-supplied name in a 97 * command line, or the HostName specified for the user-supplied name in a
@@ -1031,6 +1034,16 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1031 if (!isatty(fileno(stderr))) 1034 if (!isatty(fileno(stderr)))
1032 unset_nonblock(fileno(stderr)); 1035 unset_nonblock(fileno(stderr));
1033 1036
1037 /*
1038 * If there was no shell or command requested, there will be no remote
1039 * exit status to be returned. In that case, clear error code if the
1040 * connection was deliberately terminated at this end.
1041 */
1042 if (no_shell_flag && received_signal == SIGTERM) {
1043 received_signal = 0;
1044 exit_status = 0;
1045 }
1046
1034 if (received_signal) 1047 if (received_signal)
1035 fatal("Killed by signal %d.", (int) received_signal); 1048 fatal("Killed by signal %d.", (int) received_signal);
1036 1049