]> git.ipfire.org Git - thirdparty/chrony.git/commit
socket: rework setting of struct sockaddr_un
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Feb 2025 14:20:41 +0000 (15:20 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Feb 2025 15:10:31 +0000 (16:10 +0100)
commit3dea7dd723735d18db41f6689fa24b2b98a17b67
treee87363f81071e0878bbba4414113612352d20248
parentcb1118456b9fb1cbd3c953dbf970aa40d9dc1d29
socket: rework setting of struct sockaddr_un

Add a function to fill the Unix sockaddr for binding, connecting and
sending to avoid code duplication. Use memcpy() instead of snprintf()
and provide the minimum length of the address containing the terminating
null byte. This makes it easier to support abstract sockets if needed in
future (e.g. for systemd support).
socket.c