From: Simon Tatham Date: Mon, 31 Mar 2003 12:10:08 +0000 (+0000) Subject: pterm.c now relies on backend `exitcode' functions returning <0 when X-Git-Tag: 0.54~281 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;ds=sidebyside;h=9e59f4534b4787e2911ff322c31afe24e374c261;p=PuTTY.git pterm.c now relies on backend `exitcode' functions returning <0 when the session is still connected, and not returning an exit code until after it's finished. [originally from svn r3033] --- diff --git a/raw.c b/raw.c index 53a8fc3a..9eb2286c 100644 --- a/raw.c +++ b/raw.c @@ -217,8 +217,12 @@ static void raw_provide_logctx(void *handle, void *logctx) static int raw_exitcode(void *handle) { - /* Exit codes are a meaningless concept in the Raw protocol */ - return 0; + Raw raw = (Raw) handle; + if (raw->s != NULL) + return -1; /* still connected */ + else + /* Exit codes are a meaningless concept in the Raw protocol */ + return 0; } Backend raw_backend = { diff --git a/rlogin.c b/rlogin.c index c3ef25c9..8e73ec91 100644 --- a/rlogin.c +++ b/rlogin.c @@ -284,9 +284,12 @@ static void rlogin_provide_logctx(void *handle, void *logctx) static int rlogin_exitcode(void *handle) { - /* Rlogin rlogin = (Rlogin) handle; */ - /* If we ever implement RSH, we'll probably need to do this properly */ - return 0; + Rlogin rlogin = (Rlogin) handle; + if (rlogin->s != NULL) + return -1; /* still connected */ + else + /* If we ever implement RSH, we'll probably need to do this properly */ + return 0; } Backend rlogin_backend = { diff --git a/telnet.c b/telnet.c index 28d696d3..6f6deaea 100644 --- a/telnet.c +++ b/telnet.c @@ -996,9 +996,12 @@ static void telnet_provide_logctx(void *handle, void *logctx) static int telnet_exitcode(void *handle) { - /* Telnet telnet = (Telnet) handle; */ - /* Telnet doesn't transmit exit codes back to the client */ - return 0; + Telnet telnet = (Telnet) handle; + if (telnet->s != NULL) + return -1; /* still connected */ + else + /* Telnet doesn't transmit exit codes back to the client */ + return 0; } Backend telnet_backend = {