X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/e93ed4323c03b94653cda6ba5881c0081c3d905f..0da1a7905bb03d899c94b3d3d9b25c9e61698390:/rlogin.c diff --git a/rlogin.c b/rlogin.c index 7b13a789..8e73ec91 100644 --- a/rlogin.c +++ b/rlogin.c @@ -110,7 +110,7 @@ static char *rlogin_init(void *frontend_handle, void **backend_handle, char *err; Rlogin rlogin; - rlogin = smalloc(sizeof(*rlogin)); + rlogin = snew(struct rlogin_tag); rlogin->fn = &fn_table; rlogin->s = NULL; rlogin->frontend = frontend_handle; @@ -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 = {