changeset 8229:3718d603f9d0 HEAD

dict: Previous changes caused it to fail with "Socket already exists".
author Timo Sirainen <tss@iki.fi>
date Sun, 05 Oct 2008 14:03:35 +0300
parents c9efd231a97f
children c283babd0ab1
files src/dict/dict-server.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/dict/dict-server.c	Sun Oct 05 13:49:29 2008 +0300
+++ b/src/dict/dict-server.c	Sun Oct 05 14:03:35 2008 +0300
@@ -524,9 +524,8 @@
 
 	server = i_new(struct dict_server, 1);
 	server->path = i_strdup(path);
-	server->fd = fd;
-
-	server->fd = net_listen_unix_unlink_stale(path, 64);
+	server->fd = fd != -1 ? fd :
+		net_listen_unix_unlink_stale(path, 64);
 	if (server->fd == -1) {
 		if (errno == EADDRINUSE)
 			i_fatal("Socket already exists: %s", path);