From 914ccc56648299b41859f77b9512814c4557e255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= Date: Mon, 12 Feb 2024 16:00:44 +0000 Subject: [PATCH] first_stage_console: Address compiler warning Re-order the fields in the declaration to address the following ISO C++ requires field designators to be specified in declaration order; field 'sigaction::(anonymous union at bionic/libc/include/bits/signal_types.h:76:20)' will be initialized after field 'sa_flags' [-Wreorder-init-list] Test: TH Change-Id: I3f1d4739f1677aad50d4f07361aa264da43bdd13 --- init/first_stage_console.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/first_stage_console.cpp b/init/first_stage_console.cpp index 67cac1914..c6c3008ce 100644 --- a/init/first_stage_console.cpp +++ b/init/first_stage_console.cpp @@ -86,7 +86,9 @@ namespace init { void StartConsole(const std::string& cmdline) { bool console = KernelConsolePresent(cmdline); // Use a simple sigchld handler -- first_stage_console doesn't need to track or log zombies - const struct sigaction chld_act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDWAIT }; + const struct sigaction chld_act { + .sa_flags = SA_NOCLDWAIT, .sa_handler = SIG_DFL + }; sigaction(SIGCHLD, &chld_act, nullptr); pid_t pid = fork();