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,33 +50,33 @@
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); #endif // __sun && __SVR4
# endif // __sun && __SVR4 }
}
void do_at_exit()
{
// restore old cerr buffer
std::cerr.rdbuf(cerr_buffer);
errorlog.close();
Mpd.Disconnect();
NC::destroyScreen();
windowTitle("");
}
void do_at_exit()
{
// restore old cerr buffer
std::cerr.rdbuf(cerr_buffer);
errorlog.close();
Mpd.Disconnect();
NC::destroyScreen();
windowTitle("");
}
} }
int main(int argc, char **argv) int main(int argc, char **argv)