diff options
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 47 |
1 files changed, 24 insertions, 23 deletions
@@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.76 2009-10-15 01:45:13 tcunha Exp $ */ +/* $OpenBSD: client.c,v 1.24 2009/10/13 13:15:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -220,32 +220,33 @@ out: * Print exit status message, unless running as a login shell where it * would either be pointless or irritating. */ - if (!login_shell) { - if (sigterm) { - printf("[terminated]\n"); + if (sigterm) { + printf("[terminated]\n"); + return (1); + } + switch (cctx->exittype) { + case CCTX_DIED: + printf("[lost server]\n"); + return (0); + case CCTX_SHUTDOWN: + if (!login_shell) + printf("[server exited]\n"); + return (0); + case CCTX_EXIT: + if (cctx->errstr != NULL) { + printf("[error: %s]\n", cctx->errstr); return (1); } - switch (cctx->exittype) { - case CCTX_DIED: - printf("[lost server]\n"); - return (0); - case CCTX_SHUTDOWN: - printf("[server exited]\n"); - return (0); - case CCTX_EXIT: - if (cctx->errstr != NULL) { - printf("[error: %s]\n", cctx->errstr); - return (1); - } + if (!login_shell) printf("[exited]\n"); - return (0); - case CCTX_DETACH: + return (0); + case CCTX_DETACH: + if (!login_shell) printf("[detached]\n"); - return (0); - default: - printf("[unknown error]\n"); - return (1); - } + return (0); + default: + printf("[unknown error]\n"); + return (1); } } |