summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-10-13 13:15:26 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-10-13 13:15:26 +0000
commit0907ca19310267a40a1e4edd76ec81e2bb79231d (patch)
treea27a65bd9693a07eb3235a849446e1632a230399 /client.c
parent760e39e405fc5b31432989df146b21bb8b78c205 (diff)
Do this in a better way - print messages when exiting with nonzero.
Also remove the login shell information from server-info, only the client should care about it.
Diffstat (limited to 'client.c')
-rw-r--r--client.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/client.c b/client.c
index 214ec6a0..e7118a3b 100644
--- a/client.c
+++ b/client.c
@@ -216,32 +216,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);
}
}