From 3c112d53d0733f8dcb05d15a4c5e4f9ffffef89b Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 26 Aug 2006 09:21:52 +0000 Subject: [PATCH] Return a non-zero exit code in the event of a fatal-error SSH session termination. `Close window only on clean exit' was not working properly on Unix in the absence of this: notify_remote_exit() was being called and ssh_return_exitcode was returning zero, causing gtk_main_quit() to be called, _before_ connection_fatal() happened. git-svn-id: svn://svn.tartarus.org/sgt/putty@6801 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssh.c b/ssh.c index 38eb2bbd..969ffbc0 100644 --- a/ssh.c +++ b/ssh.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "putty.h" #include "tree234.h" @@ -8764,7 +8765,7 @@ static int ssh_return_exitcode(void *handle) if (ssh->s != NULL) return -1; else - return (ssh->exitcode >= 0 ? ssh->exitcode : 0); + return (ssh->exitcode >= 0 ? ssh->exitcode : INT_MAX); } /* -- 2.11.0