summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-09-02 20:00:10 +0000
committernicm <nicm@openbsd.org>2009-09-02 20:00:10 +0000
commitd8a4a7687ae8f73510eb955cc16496a658a8835e (patch)
tree932ac323261bdc8aa1e6c497ff560c0f414dc1e3 /usr.bin/tmux/client.c
parentAdd a minimal set of OpenFirmware compatibility interfaces. (diff)
downloadwireguard-openbsd-d8a4a7687ae8f73510eb955cc16496a658a8835e.tar.xz
wireguard-openbsd-d8a4a7687ae8f73510eb955cc16496a658a8835e.zip
Set exittype for error exit as well as the error string.
Diffstat (limited to 'usr.bin/tmux/client.c')
-rw-r--r--usr.bin/tmux/client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index b30465cc2f1..adc86d45775 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.14 2009/08/12 06:04:28 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.15 2009/09/02 20:00:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -201,7 +201,7 @@ client_main(struct client_ctx *cctx)
}
}
}
-
+
if (sigterm) {
printf("[terminated]\n");
return (1);
@@ -219,9 +219,12 @@ client_main(struct client_ctx *cctx)
case CCTX_DETACH:
printf("[detached]\n");
return (0);
- default:
+ case CCTX_ERROR:
printf("[error: %s]\n", cctx->errstr);
return (1);
+ default:
+ printf("[error: unknown error]\n");
+ return (1);
}
}
@@ -275,6 +278,7 @@ client_msg_dispatch(struct client_ctx *cctx)
printdata.msg[(sizeof printdata.msg) - 1] = '\0';
cctx->errstr = xstrdup(printdata.msg);
+ cctx->exittype = CCTX_ERROR;
imsg_free(&imsg);
return (-1);
case MSG_EXIT: