Make run_resize_screen volatile

This commit is contained in:
Andrzej Rybczak
2016-12-09 02:23:08 +01:00
parent b7386c4fa6
commit 31b2c7f55f

View File

@@ -50,18 +50,17 @@
namespace ph = std::placeholders; namespace ph = std::placeholders;
namespace namespace {
{
std::ofstream errorlog; std::ofstream errorlog;
std::streambuf *cerr_buffer; std::streambuf *cerr_buffer;
bool run_resize_screen = false;
volatile bool run_resize_screen = false;
void sighandler(int sig) void sighandler(int sig)
{ {
if (sig == SIGWINCH) if (sig == SIGWINCH)
{
run_resize_screen = true; run_resize_screen = true;
}
#if defined(__sun) && defined(__SVR4) #if defined(__sun) && defined(__SVR4)
// in solaris it is needed to reinstall the handler each time it's executed // in solaris it is needed to reinstall the handler each time it's executed
signal(sig, sighandler); signal(sig, sighandler);
@@ -77,6 +76,7 @@ namespace
NC::destroyScreen(); NC::destroyScreen();
windowTitle(""); windowTitle("");
} }
} }
int main(int argc, char **argv) int main(int argc, char **argv)