diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-26 18:50:49 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-26 18:50:49 +0000 |
commit | 5ef6d077c67b80fdb5e2153172f6d1ec1302050f (patch) | |
tree | e43cda0a503957b18d769c25c0c9191faa893b99 /client.c | |
parent | 8d019841828d30beee5c78500b07f0c80e69457e (diff) |
Join oldest session if non specified. Fix errors.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.3 2007-09-26 18:32:16 nicm Exp $ */ +/* $Id: client.c,v 1.4 2007-09-26 18:50:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -33,7 +33,7 @@ #include "tmux.h" void client_handle_winch(struct client_ctx *); -int client_process_local(struct client_ctx *, const char **); +int client_process_local(struct client_ctx *, char **); int client_init(char *path, struct client_ctx *cctx, int start_server) @@ -126,7 +126,7 @@ int client_main(struct client_ctx *cctx) { struct pollfd pfds[2]; - const char *error; + char *error; int n; logfile("client"); @@ -174,11 +174,13 @@ client_main(struct client_ctx *cctx) local_done(); - if (sigterm) - error = "received SIGTERM"; if (error != NULL) { - printf("[terminated: %s]\n", error); - return (0); + printf("[error: %s]\n", error); + return (1); + } + if (sigterm) { + printf("[terminated]\n"); + return (1); } printf("[detached]\n"); return (0); @@ -223,7 +225,7 @@ client_handle_winch(struct client_ctx *cctx) } int -client_process_local(struct client_ctx *cctx, const char **error) +client_process_local(struct client_ctx *cctx, char **error) { struct buffer *b; size_t size; |