From: Jim Radford Date: Wed, 7 Aug 2013 20:05:47 +0000 (-0700) Subject: memcached plugin: actually connect when using a unix socket X-Git-Tag: collectd-5.4.0~1^2^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=eb50b18ed7827855868825c97d3ba73f0272a426;p=collectd.git memcached plugin: actually connect when using a unix socket Signed-off-by: Florian Forster --- 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 */