summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-07 02:34:17 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-07 02:34:17 +0200
commit0e098b15c76e222f7de381203c0c35a75a5b2f24 (patch)
tree864b2b06696c7fcc4d0c29daa3121574c52f004b /src/systemctl.c
parente983b76024342278a0377eae116c925f2567776e (diff)
util: never use sizeof(sa_family_t) when calculating sockaddr sizes
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 45249aaa3b..918dcbe8b5 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/stat.h>
+#include <stddef.h>
#include <dbus/dbus.h>
@@ -4875,7 +4876,7 @@ static int send_shutdownd(usec_t t, char mode, bool warn, const char *message) {
zero(msghdr);
msghdr.msg_name = &sockaddr;
- msghdr.msg_namelen = sizeof(sa_family_t) + 1 + sizeof("/org/freedesktop/systemd1/shutdownd") - 1;
+ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + 1 + sizeof("/org/freedesktop/systemd1/shutdownd") - 1;
msghdr.msg_iov = &iovec;
msghdr.msg_iovlen = 1;