From 71c88f6a1d37e51f085fc8eeb71b0033602029a3 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 10 Jun 2015 18:37:02 +0200 Subject: call: Harden against compiler overoptimization. A compiler won't know that the interrupted variable can be changed behind its back in a signal handler so it might do clever overoptimizations. Signed-off-by: Ralf Baechle --- call/call.c | 2 +- call/call.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/call/call.c b/call/call.c index f7a7770..2f606bd 100644 --- a/call/call.c +++ b/call/call.c @@ -79,7 +79,7 @@ static char *mycall; static int stdin_is_tty = 1; -int interrupted = FALSE; +volatile int interrupted = FALSE; int paclen; int fd; diff --git a/call/call.h b/call/call.h index b7723d7..2a91364 100644 --- a/call/call.h +++ b/call/call.h @@ -5,7 +5,7 @@ #define TRUE 1 #endif extern int fd; -extern int interrupted; +extern volatile int interrupted; extern int paclen; /* In call.c */ -- cgit v1.2.3