From 0b78399f4f9d4b3cd53bf9f0ee923c1001bc2645 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Jul 2010 02:45:39 +0200 Subject: [PATCH] =?utf8?q?systemd:=20update=20sd-daemon.[ch]=20from=20up?= =?utf8?q?=C5=9Btream?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- avahi-daemon/sd-daemon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/avahi-daemon/sd-daemon.c b/avahi-daemon/sd-daemon.c index 5df70e3..3bb258d 100644 --- a/avahi-daemon/sd-daemon.c +++ b/avahi-daemon/sd-daemon.c @@ -381,7 +381,11 @@ int sd_notify(int unset_environment, const char *state) { memset(&msghdr, 0, sizeof(msghdr)); msghdr.msg_name = &sockaddr; - msghdr.msg_namelen = sizeof(struct sockaddr_un); + msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e); + + if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) + msghdr.msg_namelen = sizeof(struct sockaddr_un); + msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; msghdr.msg_control = &control; -- 2.39.5