diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-09-02 20:00:10 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-09-02 20:00:10 +0000 |
commit | 7a4bac82d7d3cc355c92b312fda00fa9523e79f9 (patch) | |
tree | e9627e47b3f2379606340841357e1c720c7c564f | |
parent | 74c35c513efc616cd56aa9bd1d7b2561fd6df132 (diff) | |
download | rtmux-7a4bac82d7d3cc355c92b312fda00fa9523e79f9.tar.gz rtmux-7a4bac82d7d3cc355c92b312fda00fa9523e79f9.tar.bz2 rtmux-7a4bac82d7d3cc355c92b312fda00fa9523e79f9.zip |
Set exittype for error exit as well as the error string.
-rw-r--r-- | client.c | 8 | ||||
-rw-r--r-- | tmux.h | 1 |
2 files changed, 7 insertions, 2 deletions
@@ -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: @@ -974,6 +974,7 @@ struct client_ctx { CCTX_EXIT, CCTX_DIED, CCTX_SHUTDOWN, + CCTX_ERROR } exittype; const char *errstr; }; |