aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Servo <me@tomservo.cc>2008-11-07 10:33:48 +0100
committerMax Kellermann <max@duempel.org>2008-11-07 10:33:48 +0100
commitea92576219fd33e92ddf5e7bb0d802498c5bed75 (patch)
tree448fcb3f0feb23460aa11e575a291a78b2bcad9a
parent2e0ba90208260fa623e1d5c326a048c3aa5093fe (diff)
downloadmpd-ea92576219fd33e92ddf5e7bb0d802498c5bed75.tar.gz
mpd-ea92576219fd33e92ddf5e7bb0d802498c5bed75.tar.xz
mpd-ea92576219fd33e92ddf5e7bb0d802498c5bed75.zip
listen: fix namespace collision on OpenSolaris
The listen.c module breaks the build because the variable name used ("sun") for the Unix domain socket part collides with something else on an OpenSolaris system, likely Sun specific. Renaming it to _sun (or something else of choice) fixes the build. [mk: renamed to "s_un"]
-rw-r--r--src/listen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/listen.c b/src/listen.c
index 00a21b81b..9a4d60555 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -159,19 +159,19 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
#ifdef HAVE_UN
} else if (param->value[0] == '/') {
size_t path_length;
- struct sockaddr_un sun;
+ struct sockaddr_un s_un;
path_length = strlen(param->value);
- if (path_length >= sizeof(sun.sun_path))
+ if (path_length >= sizeof(s_un.sun_path))
FATAL("unix socket path is too long\n");
unlink(param->value);
- sun.sun_family = AF_UNIX;
- memcpy(sun.sun_path, param->value, path_length + 1);
+ s_un.sun_family = AF_UNIX;
+ memcpy(s_un.sun_path, param->value, path_length + 1);
- addrp = (const struct sockaddr *)&sun;
- addrlen = sizeof(sun);
+ addrp = (const struct sockaddr *)&s_un;
+ addrlen = sizeof(s_un);
if (establishListen(PF_UNIX, addrp, addrlen) < 0)
FATAL("unable to bind to %s: %s\n",