diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-26 18:32:17 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-26 18:32:17 +0000 |
commit | 8d019841828d30beee5c78500b07f0c80e69457e (patch) | |
tree | e9238a4e69073bebb8e3152083395e097134247a /client.c | |
parent | 2aacbe764c90218cb8383efbd4f6f74812b3b00c (diff) | |
download | rtmux-8d019841828d30beee5c78500b07f0c80e69457e.tar.gz rtmux-8d019841828d30beee5c78500b07f0c80e69457e.tar.bz2 rtmux-8d019841828d30beee5c78500b07f0c80e69457e.zip |
Restore list command.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.2 2007-09-26 18:12:19 nicm Exp $ */ +/* $Id: client.c,v 1.3 2007-09-26 18:32:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -36,7 +36,7 @@ void client_handle_winch(struct client_ctx *); int client_process_local(struct client_ctx *, const char **); int -client_init(char *path, struct client_ctx *cctx, int ws) +client_init(char *path, struct client_ctx *cctx, int start_server) { struct sockaddr_un sa; struct stat sb; @@ -52,7 +52,7 @@ client_init(char *path, struct client_ctx *cctx, int ws) retries = 0; retry: if (stat(path, &sb) != 0) { - if (errno != ENOENT) { + if (!start_server || errno != ENOENT) { log_warn("%s", path); return (-1); } @@ -66,7 +66,7 @@ retry: return (-1); } - if (ws) { + if (start_server) { if (!isatty(STDIN_FILENO)) { log_warnx("stdin is not a tty"); return (-1); @@ -96,7 +96,7 @@ retry: } if (connect( cctx->srv_fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1) { - if (errno == ECONNREFUSED && retries < 5) { + if (start_server && errno == ECONNREFUSED && retries < 5) { if (unlink(path) != 0) { log_warn("%s: unlink", path); return (-1); |