From: Miroslav Lichvar Date: Wed, 30 Jul 2025 12:23:45 +0000 (+0200) Subject: socket: rename sun variable to fix compilation on illumos X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eaf8bc5210742152f8b5532266db89e348e945d;p=thirdparty%2Fchrony.git socket: rename sun variable to fix compilation on illumos "sun" is reserved on Solaris/illumos. Fixes: 3dea7dd72373 ("socket: rework setting of struct sockaddr_un") --- diff --git a/socket.c b/socket.c index 06cd8821..a01ad74c 100644 --- a/socket.c +++ b/socket.c @@ -604,18 +604,18 @@ error: /* ================================================== */ static socklen_t -set_unix_sockaddr(struct sockaddr_un *sun, const char *addr) +set_unix_sockaddr(struct sockaddr_un *sa, const char *addr) { size_t len = strlen(addr); - if (len + 1 > sizeof (sun->sun_path)) { + if (len + 1 > sizeof (sa->sun_path)) { DEBUG_LOG("Unix socket path %s too long", addr); return 0; } - memset(sun, 0, sizeof (*sun)); - sun->sun_family = AF_UNIX; - memcpy(sun->sun_path, addr, len); + memset(sa, 0, sizeof (*sa)); + sa->sun_family = AF_UNIX; + memcpy(sa->sun_path, addr, len); return offsetof(struct sockaddr_un, sun_path) + len + 1; }