From 7a4bac82d7d3cc355c92b312fda00fa9523e79f9 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 2 Sep 2009 20:00:10 +0000 Subject: Set exittype for error exit as well as the error string. --- client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 359d9482..bd062c69 100644 --- a/client.c +++ b/client.c @@ -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: -- cgit v1.2.3