This is an automated email from the ASF dual-hosted git repository. simbit18 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit ddc699a4f3f5870d837f1b15589b6c872c6bd156 Author: makejian <[email protected]> AuthorDate: Tue Jan 20 13:52:59 2026 +0800 system/cu: fix signal handler to use sa_sigaction The sigint() function uses siginfo->si_user but was declared with only one parameter (int sig). This causes compilation error because siginfo is undeclared. Fix by: 1. Rename sigint to cu_exit with proper sigaction signature 2. Use sa_sigaction instead of sa_handler to receive siginfo_t 3. Pass cu pointer via sa.sa_user for signal handler access Signed-off-by: makejian <[email protected]> --- system/cu/cu_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index 6e25acfc9..fbb3350aa 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -123,7 +123,7 @@ static FAR void *cu_listener(FAR void *parameter) } #ifdef CONFIG_ENABLE_ALL_SIGNALS -static void sigint(int sig) +static void cu_exit(int signo, FAR siginfo_t *siginfo, FAR void *context) { FAR struct cu_globals_s *cu = siginfo->si_user; cu->force_exit = true; @@ -302,8 +302,15 @@ int main(int argc, FAR char *argv[]) /* Install signal handlers */ memset(&sa, 0, sizeof(sa)); - sa.sa_handler = sigint; - sigaction(SIGINT, &sa, NULL); + sa.sa_user = &cu; + sa.sa_sigaction = cu_exit; + sigemptyset(&sa.sa_mask); + if (sigaction(SIGINT, &sa, NULL) < 0) + { + cu_error("cu_main: ERROR during setup cu_exit sigaction(): %d\n", + errno); + return EXIT_FAILURE; + } #endif optind = 0; /* Global that needs to be reset in FLAT mode */ while ((option = getopt(argc, argv, "l:s:ceE:fho?")) != ERROR)
