X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsystemctl.c;h=918dcbe8b542aa9dcae08a4049fdaa61db5c11a6;hb=0e098b15c76e222f7de381203c0c35a75a5b2f24;hp=45249aaa3b0e9834e56a9581ca8a85e253e1477e;hpb=e983b76024342278a0377eae116c925f2567776e;p=elogind.git diff --git a/src/systemctl.c b/src/systemctl.c index 45249aaa3..918dcbe8b 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -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;