From: Florian Forster Date: Tue, 30 Dec 2008 15:46:38 +0000 (+0100) Subject: libcollectdclient: Don't use `PF_UNIX', it's broken on Mac OS X. X-Git-Tag: collectd-4.6.0~117 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=924a111c2d04aa8ff3386805f0fb022fe4f8f7b1;p=collectd.git libcollectdclient: Don't use `PF_UNIX', it's broken on Mac OS X. Under Mac OS X (10.4, possibly others), PF_UNIX is defined as PF_LOCAL, which in turn is defined as AF_LOCAL. AF_LOCAL, however, is only defined if POSIX_C_SOURCE is not. --- diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 96b828ea..b2f2daff 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -363,7 +363,9 @@ static int lcc_open_unixsocket (lcc_connection_t *c, const char *path) /* {{{ */ assert (c->fh == NULL); assert (path != NULL); - fd = socket (PF_UNIX, SOCK_STREAM, /* protocol = */ 0); + /* Don't use PF_UNIX here, because it's broken on Mac OS X (10.4, possibly + * others). */ + fd = socket (AF_UNIX, SOCK_STREAM, /* protocol = */ 0); if (fd < 0) { lcc_set_errno (c, errno);