batctl: Avoid overoptimization of signal related check
PATCH 1/1 batctl: Avoid overoptimization of signal related check
According to C99, it is not safe to use a simple char for checks because the compiler may optimizes it away when it only gets modified in a signal handler. It is also undefined when the signal is modifying an object with static storage duration not from type volatile sig_atomic_t.
Signed-off-by Sven Eckelmann <[email protected]>
--- ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ping.c +1 -1
@@ -44,7 +44,7 @@#include "debugfs.h" -char is_aborted =0 ; +static volatile sig_atomic_t is_aborted =0 ;static void ping_usage (void )
Signature · 1 line
2.0.0.rc2