summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-daemon/sd-daemon.c
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2016-05-07 19:17:44 +0300
committerEvgeny Vereshchagin <evvers@ya.ru>2016-05-07 19:17:44 +0300
commit5ab42bc85a11a5250dcdf8e86291d3da90aa84bd (patch)
tree1493f86c5031484546ab98d242303101d3b43017 /src/libsystemd/sd-daemon/sd-daemon.c
parentd2cc96a8e134e8166acb917f67b3e8b308e09370 (diff)
parent23be5709e10b3b88a9908f3005351ccba9e5d48b (diff)
Merge pull request #3191 from poettering/cgroups-agent-dgram
core: use an AF_UNIX/SOCK_DGRAM socket for cgroup agent notification
Diffstat (limited to 'src/libsystemd/sd-daemon/sd-daemon.c')
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index bd1c7f15ff..4da9dbfd63 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -458,9 +458,7 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
if (sockaddr.un.sun_path[0] == '@')
sockaddr.un.sun_path[0] = 0;
- msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);
- if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
- msghdr.msg_namelen = sizeof(struct sockaddr_un);
+ msghdr.msg_namelen = SOCKADDR_UN_LEN(sockaddr.un);
have_pid = pid != 0 && pid != getpid();