diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-13 06:33:41 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-16 14:57:42 +0100 |
commit | 144faa8ea505158d2d8a3fd9bbe58addefd05077 (patch) | |
tree | 3d84e1a6f308655aff67528d6e857977d97be2fb /src/libsystemd-network/sd-ndisc.c | |
parent | sd-radv: do not unref() event sources when update or disable them (diff) | |
download | systemd-144faa8ea505158d2d8a3fd9bbe58addefd05077.tar.xz systemd-144faa8ea505158d2d8a3fd9bbe58addefd05077.zip |
sd-ndisc: use structured initializer at one more place
Diffstat (limited to '')
-rw-r--r-- | src/libsystemd-network/sd-ndisc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index b2fd087987..6715f72d34 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -136,12 +136,14 @@ _public_ int sd_ndisc_new(sd_ndisc **ret) { assert_return(ret, -EINVAL); - nd = new0(sd_ndisc, 1); + nd = new(sd_ndisc, 1); if (!nd) return -ENOMEM; - nd->n_ref = 1; - nd->fd = -1; + *nd = (sd_ndisc) { + .n_ref = 1, + .fd = -1, + }; *ret = TAKE_PTR(nd); |