From: Lennart Poettering Date: Thu, 7 Mar 2019 15:39:17 +0000 (+0100) Subject: execute: use structured initialization X-Git-Tag: v242-rc1~158^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e8009dc500247da26e5414571c60d20ad3b8483;p=thirdparty%2Fsystemd.git execute: use structured initialization --- diff --git a/src/core/execute.c b/src/core/execute.c index 39d9f07518b..0336083b0e2 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; }