summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-07-23 13:15:41 +0000
committerTiago Cunha <tcunha@gmx.com>2009-07-23 13:15:41 +0000
commit7174c76bf0fadc220e04de2f8ab92ebae117b510 (patch)
tree4e8adcdf132a86e806f3333884acb675a7458ea4 /client.c
parent6708ad19c5acc28d3a1a1ad710fd4624365f68e2 (diff)
Sync OpenBSD patchset 166:
Pass a set of flags into client_init rather than just a start_server variable. Only one flag now but more to come later.
Diffstat (limited to 'client.c')
-rw-r--r--client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/client.c b/client.c
index 977313ff..604beba5 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.53 2009-07-01 23:06:32 nicm Exp $ */
+/* $Id: client.c,v 1.54 2009-07-23 13:15:41 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -36,7 +36,7 @@
void client_handle_winch(struct client_ctx *);
int
-client_init(char *path, struct client_ctx *cctx, int start_server, int flags)
+client_init(char *path, struct client_ctx *cctx, int cmdflags, int flags)
{
struct sockaddr_un sa;
struct stat sb;
@@ -57,7 +57,7 @@ client_init(char *path, struct client_ctx *cctx, int start_server, int flags)
#endif
if (lstat(path, &sb) != 0) {
- if (start_server && errno == ENOENT) {
+ if (cmdflags & CMD_STARTSERVER && errno == ENOENT) {
if ((cctx->srv_fd = server_start(path)) == -1)
goto start_failed;
goto server_started;
@@ -83,7 +83,7 @@ client_init(char *path, struct client_ctx *cctx, int start_server, int flags)
if (connect(
cctx->srv_fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1) {
if (errno == ECONNREFUSED) {
- if (unlink(path) != 0 || !start_server)
+ if (unlink(path) != 0 || !(cmdflags & CMD_STARTSERVER))
goto not_found;
if ((cctx->srv_fd = server_start(path)) == -1)
goto start_failed;