From 24493e9169d3058958ab3ec4d2b02c5753954981 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Fri, 4 Oct 2019 12:20:02 +0200 Subject: Fixed undefined behavior on signals. The C11 specification allows only sig_atomic_t and _Atomic variable access. All other accesses to global variables are undefined behavior. Using int was probably OK on x86 and x86_64; yet there were some reports from other architectures (especially some MIPS) that in rare cases, after issuing SIGHUP, BIRD did strange things. --- sysdep/unix/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdep/unix/main.c') diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index db848033..a52ae3ca 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -601,9 +601,9 @@ cmd_graceful_restart(void) * Signals */ -volatile int async_config_flag; -volatile int async_dump_flag; -volatile int async_shutdown_flag; +volatile sig_atomic_t async_config_flag; +volatile sig_atomic_t async_dump_flag; +volatile sig_atomic_t async_shutdown_flag; static void handle_sighup(int sig UNUSED) -- cgit v1.2.3