summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-05-03 16:04:38 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-05-03 16:04:43 -0400
commit93fc111c3c701a588f6ba7c39e514f8ffec425a4 (patch)
tree94fffb582ebec277050fce234c56ba3cb2d9abc9
parent5100dad0773e8edef6ba87365d7a5a7bddddd22c (diff)
src/udev/udevd.c: remove initializer for struct for gcc-4.5.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/udev/udevd.c22
1 files 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)