-/* $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>
/* 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);
}