From ac8b5bd0bc7f48ae7fe6156f8a20732f696ea143 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 2 Nov 2023 12:55:46 -0700 Subject: [PATCH] init: Fix a compiler warning Fix the following compiler warning: system/core/init/init.cpp:754:57: warning: ISO C++ requires field designators to be specified in declaration order; field '' will be initialized after field 'sa_flags' [-Wreorder-init-list] const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP }; ^~~~~~~~~~~~~~~~~~~~~~~~ system/core/init/init.cpp:754:34: note: previous initialization for field '' is here const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP }; ^~~~~~~~~~~~~~~~~~~~~ Change-Id: I29e2d51dfdff85212a33eebfd51b241268cdfe9a Signed-off-by: Bart Van Assche --- init/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/init.cpp b/init/init.cpp index 40e21696f..19f34dabb 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -751,7 +751,7 @@ static void UnblockSignals() { static void InstallSignalFdHandler(Epoll* epoll) { // Applying SA_NOCLDSTOP to a defaulted SIGCHLD handler prevents the signalfd from receiving // SIGCHLD when a child process stops or continues (b/77867680#comment9). - const struct sigaction act { .sa_handler = SIG_DFL, .sa_flags = SA_NOCLDSTOP }; + const struct sigaction act { .sa_flags = SA_NOCLDSTOP, .sa_handler = SIG_DFL }; sigaction(SIGCHLD, &act, nullptr); sigset_t mask;