diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-03-07 16:39:17 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-03-07 16:53:45 +0100 |
commit | 8e8009dc500247da26e5414571c60d20ad3b8483 (patch) | |
tree | 5452bc61985720342083aebfd46d5e1c7e71cb86 | |
parent | units: fix systemd.special man page reference in system-update-cleanup.service (diff) | |
download | systemd-8e8009dc500247da26e5414571c60d20ad3b8483.tar.xz systemd-8e8009dc500247da26e5414571c60d20ad3b8483.zip |
execute: use structured initialization
-rw-r--r-- | src/core/execute.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 39d9f07518..0336083b0e 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -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; } |