Turned the old `Telnet Command' System-submenu into a more general
[u/mdw/putty] / rlogin.c
index c3ef25c..c12a080 100644 (file)
--- a/rlogin.c
+++ b/rlogin.c
@@ -248,6 +248,15 @@ static void rlogin_special(void *handle, Telnet_Special code)
     return;
 }
 
+/*
+ * Return a list of the special codes that make sense in this
+ * protocol.
+ */
+static const struct telnet_special *rlogin_get_specials(void *handle)
+{
+    return NULL;
+}
+
 static Socket rlogin_socket(void *handle)
 {
     Rlogin rlogin = (Rlogin) handle;
@@ -284,9 +293,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 = {
@@ -297,6 +309,7 @@ Backend rlogin_backend = {
     rlogin_sendbuffer,
     rlogin_size,
     rlogin_special,
+    rlogin_get_specials,
     rlogin_socket,
     rlogin_exitcode,
     rlogin_sendok,