]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: use structured initialization
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Mar 2019 15:39:17 +0000 (16:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Mar 2019 15:53:45 +0000 (16:53 +0100)
src/core/execute.c

index 39d9f07518be500a829ad43997ee81c1cfb40eae..0336083b0e20998b6618f81ae7e1c6b610e9dc92 100644 (file)
@@ -4864,14 +4864,20 @@ static void exec_runtime_freep(ExecRuntime **rt) {
                 (void) exec_runtime_free(*rt, false);
 }
 
-static int exec_runtime_allocate(ExecRuntime **rt) {
-        assert(rt);
+static int exec_runtime_allocate(ExecRuntime **ret) {
+        ExecRuntime *n;
 
-        *rt = new0(ExecRuntime, 1);
-        if (!*rt)
+        assert(ret);
+
+        n = new(ExecRuntime, 1);
+        if (!n)
                 return -ENOMEM;
 
-        (*rt)->netns_storage_socket[0] = (*rt)->netns_storage_socket[1] = -1;
+        *n = (ExecRuntime) {
+                .netns_storage_socket = { -1, -1 },
+        };
+
+        *ret = n;
         return 0;
 }