summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/client.c10
-rw-r--r--usr.bin/tmux/tmux.h3
2 files changed, 9 insertions, 4 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:
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 9299ca67776..7d36f59a03d 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.96 2009/09/02 17:34:57 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.97 2009/09/02 20:00:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -974,6 +974,7 @@ struct client_ctx {
CCTX_EXIT,
CCTX_DIED,
CCTX_SHUTDOWN,
+ CCTX_ERROR
} exittype;
const char *errstr;
};