]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
pterm.c now relies on backend `exitcode' functions returning <0 when
authorSimon Tatham <anakin@pobox.com>
Mon, 31 Mar 2003 12:10:08 +0000 (12:10 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 31 Mar 2003 12:10:08 +0000 (12:10 +0000)
the session is still connected, and not returning an exit code until
after it's finished.

[originally from svn r3033]

raw.c
rlogin.c
telnet.c

diff --git a/raw.c b/raw.c
index 53a8fc3a765bf0a7f6e6deb96973edc6a7efd886..9eb2286c9276e087bde6452c11cfbe3ac2a30f08 100644 (file)
--- 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 = {
index c3ef25c95c38d66b4d728b3ed994505f0a9a940e..8e73ec91650eac30937af218dffef0f8cf2ad6e9 100644 (file)
--- 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 = {
index 28d696d31a1f69b498da55147078adf5ff7ed596..6f6deaea754551ff1c5af92d7791f48ae7cd5c6e 100644 (file)
--- 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 = {