From 924a111c2d04aa8ff3386805f0fb022fe4f8f7b1 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 30 Dec 2008 16:46:38 +0100 Subject: [PATCH] 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. --- src/libcollectdclient/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.11.0