From eb50b18ed7827855868825c97d3ba73f0272a426 Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Wed, 7 Aug 2013 13:05:47 -0700 Subject: [PATCH] memcached plugin: actually connect when using a unix socket Signed-off-by: Florian Forster --- src/memcached.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/memcached.c b/src/memcached.c index a09f45ec..2a5e0f0f 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -84,6 +84,15 @@ static int memcached_connect_unix (memcached_t *st) return (-1); } + /* connect to the memcached daemon */ + int status = connect (fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); + if (status != 0) + { + shutdown (fd, SHUT_RDWR); + close (fd); + fd = -1; + } + return (fd); } /* int memcached_connect_unix */ -- 2.11.0