summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-09-02 20:00:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-09-02 20:00:11 +0000
commit4368740666b3af0f30f07bdc94cbdc3ec5e46ed1 (patch)
tree9a4cc54ea02487f0e57019df45fd7482878bd8ac /usr.bin/tmux/client.c
parente283f0801e842d8e892c2e0b0ca16639486b1819 (diff)
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: