From bb65b82c56c61fb2ecb839e253b2bcadfe78f910 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 21 Jan 2017 13:33:46 -0800 Subject: [PATCH] Mark some signal-related variables as 'volatile sig_atomic_t' --- src/reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index 6ae326472..b53037093 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -286,7 +286,7 @@ static reader_data_t *data = 0; /// This flag is set to true when fish is interactively reading from stdin. It changes how a ^C is /// handled by the fish interrupt handler. -static int is_interactive_read; +static volatile sig_atomic_t is_interactive_read; /// Flag for ending non-interactive shell. static int end_loop = 0; @@ -295,7 +295,7 @@ static int end_loop = 0; static std::stack > current_filename; /// This variable is set to true by the signal handler when ^C is pressed. -static volatile int interrupted = 0; +static volatile sig_atomic_t interrupted = 0; // Prototypes for a bunch of functions defined later on. static bool is_backslashed(const wcstring &str, size_t pos);