mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 15:45:07 -05:00
socket: rename sun variable to fix compilation on illumos
"sun" is reserved on Solaris/illumos.
Fixes: 3dea7dd723 ("socket: rework setting of struct sockaddr_un")
This commit is contained in:
10
socket.c
10
socket.c
@@ -604,18 +604,18 @@ error:
|
|||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
static socklen_t
|
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);
|
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);
|
DEBUG_LOG("Unix socket path %s too long", addr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(sun, 0, sizeof (*sun));
|
memset(sa, 0, sizeof (*sa));
|
||||||
sun->sun_family = AF_UNIX;
|
sa->sun_family = AF_UNIX;
|
||||||
memcpy(sun->sun_path, addr, len);
|
memcpy(sa->sun_path, addr, len);
|
||||||
|
|
||||||
return offsetof(struct sockaddr_un, sun_path) + len + 1;
|
return offsetof(struct sockaddr_un, sun_path) + len + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user