summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-13 06:26:00 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-16 14:57:42 +0100
commit8158b90d5967b195c73368e71eb17a465a20cdde (patch)
tree803452db56a922b26ea7b1c803e3ae1134a7d4ef
parentipv4acd: do not unref() event sources when update or disable them (diff)
downloadsystemd-8158b90d5967b195c73368e71eb17a465a20cdde.tar.xz
systemd-8158b90d5967b195c73368e71eb17a465a20cdde.zip
lldp: use structured initializer at one more place
-rw-r--r--src/libsystemd-network/sd-lldp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 993ca13727..ffc6db030c 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -361,14 +361,16 @@ _public_ int sd_lldp_new(sd_lldp **ret) {
assert_return(ret, -EINVAL);
- lldp = new0(sd_lldp, 1);
+ lldp = new(sd_lldp, 1);
if (!lldp)
return -ENOMEM;
- lldp->n_ref = 1;
- lldp->fd = -1;
- lldp->neighbors_max = LLDP_DEFAULT_NEIGHBORS_MAX;
- lldp->capability_mask = (uint16_t) -1;
+ *lldp = (sd_lldp) {
+ .n_ref = 1,
+ .fd = -1,
+ .neighbors_max = LLDP_DEFAULT_NEIGHBORS_MAX,
+ .capability_mask = (uint16_t) -1,
+ };
lldp->neighbor_by_id = hashmap_new(&lldp_neighbor_id_hash_ops);
if (!lldp->neighbor_by_id)