From: nicm Date: Tue, 21 Apr 2015 22:21:41 +0000 (+0000) Subject: Simplify error messages when socket connect fails, suggested by "Karthik K". X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3ccbc5e0c1433c32ecbfd927f489f16e454bc893;p=openbsd Simplify error messages when socket connect fails, suggested by "Karthik K". --- 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 @@ -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); }