From 6bf8e24bad8bd001d8587d7922842341c32888c2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 23 Jul 2019 15:47:33 +0900 Subject: [PATCH] sd-netlink: use structured initializer --- src/libsystemd/sd-netlink/netlink-message.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index 58ec1ef..e1395c6 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -31,13 +31,15 @@ int message_new_empty(sd_netlink *rtnl, sd_netlink_message **ret) { buses and their queued messages. See sd-bus. */ - m = new0(sd_netlink_message, 1); + m = new(sd_netlink_message, 1); if (!m) return -ENOMEM; - m->n_ref = 1; - m->protocol = rtnl->protocol; - m->sealed = false; + *m = (sd_netlink_message) { + .n_ref = 1, + .protocol = rtnl->protocol, + .sealed = false, + }; *ret = m; -- 2.7.4