From 93fc111c3c701a588f6ba7c39e514f8ffec425a4 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Sun, 3 May 2015 16:04:38 -0400 Subject: src/udev/udevd.c: remove initializer for struct for gcc-4.5. Signed-off-by: Anthony G. Basile --- src/udev/udevd.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 5916b58165..17b29818f2 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -592,25 +592,27 @@ static void event_queue_cleanup(struct udev *udev, enum event_state match_type) static void worker_returned(int fd_worker) { for (;;) { struct worker_message msg; - struct iovec iovec = { - .iov_base = &msg, - .iov_len = sizeof(msg), - }; + struct iovec iovec; union { struct cmsghdr cmsghdr; uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; } control = {}; - struct msghdr msghdr = { - .msg_iov = &iovec, - .msg_iovlen = 1, - .msg_control = &control, - .msg_controllen = sizeof(control), - }; + struct msghdr msghdr; struct cmsghdr *cmsg; ssize_t size; struct ucred *ucred = NULL; struct udev_list_node *loop; + memzero(&iovec, sizeof(struct iovec)); + iovec.iov_base = &msg; + iovec.iov_len = sizeof(msg); + + memzero(&msghdr, sizeof(struct msghdr)); + msghdr.msg_iov = &iovec; + msghdr.msg_iovlen = 1; + msghdr.msg_control = &control; + msghdr.msg_controllen = sizeof(control); + size = recvmsg(fd_worker, &msghdr, MSG_DONTWAIT); if (size < 0) { if (errno == EAGAIN || errno == EINTR) -- cgit v1.2.3-54-g00ecf