aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-09-26 18:32:17 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-09-26 18:32:17 +0000
commit8d019841828d30beee5c78500b07f0c80e69457e (patch)
treee9238a4e69073bebb8e3152083395e097134247a /client.c
parent2aacbe764c90218cb8383efbd4f6f74812b3b00c (diff)
downloadrtmux-8d019841828d30beee5c78500b07f0c80e69457e.tar.gz
rtmux-8d019841828d30beee5c78500b07f0c80e69457e.tar.bz2
rtmux-8d019841828d30beee5c78500b07f0c80e69457e.zip
Restore list command.
Diffstat (limited to 'client.c')
-rw-r--r--client.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/client.c b/client.c
index ed33baff..3bddde4a 100644
--- a/client.c
+++ b/client.c
@@ -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);