summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-04-21 22:21:42 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-04-21 22:21:42 +0000
commitd4e8e4235f6c369c02e1a80667ab325eae43fe7a (patch)
tree322591a10794158e5f7105c5f948b8c2cb125137
parentad491cd6d80ad77525ad9e0380bf37e8175b2146 (diff)
Simplify error messages when socket connect fails, suggested by "Karthik K".
-rw-r--r--usr.bin/tmux/client.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index d8c16fc50cc..9dfd20d6874 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.86 2015/03/31 17:45:10 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.87 2015/04/21 22:21:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -265,8 +265,13 @@ client_main(int argc, char **argv, int flags)
/* Initialize the client socket and start the server. */
fd = client_connect(socket_path, cmdflags & CMD_STARTSERVER);
if (fd == -1) {
- fprintf(stderr, "failed to connect to server: %s\n",
- strerror(errno));
+ if (errno == ECONNREFUSED) {
+ fprintf(stderr, "no server running on %s\n",
+ socket_path);
+ } else {
+ fprintf(stderr, "error connecting to %s (%s)\n",
+ socket_path, strerror(errno));
+ }
return (1);
}