]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: use structured initialization for DnsScope
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Dec 2018 12:31:29 +0000 (13:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Dec 2018 10:04:11 +0000 (11:04 +0100)
src/resolve/resolved-dns-scope.c

index 35c3804dbabc98583ce7d42564a68a8f638c0375..8ea46054a6de62d7084a11b239e5970a71df24b3 100644 (file)
@@ -30,15 +30,17 @@ int dns_scope_new(Manager *m, DnsScope **ret, Link *l, DnsProtocol protocol, int
         assert(m);
         assert(ret);
 
-        s = new0(DnsScope, 1);
+        s = new(DnsScope, 1);
         if (!s)
                 return -ENOMEM;
 
-        s->manager = m;
-        s->link = l;
-        s->protocol = protocol;
-        s->family = family;
-        s->resend_timeout = MULTICAST_RESEND_TIMEOUT_MIN_USEC;
+        *s = (DnsScope) {
+                .manager = m,
+                .link = l,
+                .protocol = protocol,
+                .family = family,
+                .resend_timeout = MULTICAST_RESEND_TIMEOUT_MIN_USEC,
+        };
 
         if (protocol == DNS_PROTOCOL_DNS) {
                 /* Copy DNSSEC mode from the link if it is set there,