changeset 12143:c6783cbd0235

dict client: If connect to server socket fails with EACCES, give better error message.
author Timo Sirainen <tss@iki.fi>
date Tue, 21 Sep 2010 14:59:59 +0100
parents 0c22286d5fc7
children 0d101d089b5b
files src/lib-dict/dict-client.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-dict/dict-client.c	Tue Sep 21 14:55:33 2010 +0100
+++ b/src/lib-dict/dict-client.c	Tue Sep 21 14:59:59 2010 +0100
@@ -6,6 +6,7 @@
 #include "network.h"
 #include "istream.h"
 #include "ostream.h"
+#include "eacces-error.h"
 #include "dict-private.h"
 #include "dict-client.h"
 
@@ -408,7 +409,13 @@
 	dict->fd = net_connect_unix(dict->path);
 	if (dict->fd == -1) {
 		dict->last_failed_connect = ioloop_time;
-		i_error("net_connect_unix(%s) failed: %m", dict->path);
+		if (errno == EACCES) {
+			i_fatal("%s", eacces_error_get("net_connect_unix",
+						       dict->path));
+		} else {
+			i_fatal("net_connect_unix(%s) failed: %m",
+				dict->path);
+		}
 		return -1;
 	}