set SIGWINCH handler before initializing ncurses to avoid races

This commit is contained in:
Andrzej Rybczak
2015-05-02 20:43:19 +02:00
parent bb4c0a9d4c
commit 5a3a2fbbf1
2 changed files with 8 additions and 7 deletions

View File

@@ -111,6 +111,13 @@ int main(int argc, char **argv)
cerr_buffer = std::cerr.rdbuf();
std::cerr.rdbuf(errorlog.rdbuf());
# ifndef WIN32
signal(SIGPIPE, sighandler);
signal(SIGWINCH, sighandler);
// ignore Ctrl-C
sigignore(SIGINT);
# endif // !WIN32
NC::initScreen("ncmpcpp ver. " VERSION, Config.colors_enabled);
Actions::OriginalStatusbarVisibility = Config.statusbar_visibility;
@@ -146,13 +153,6 @@ int main(int argc, char **argv)
if (Config.mouse_support)
mousemask(ALL_MOUSE_EVENTS, 0);
# ifndef WIN32
signal(SIGPIPE, sighandler);
signal(SIGWINCH, sighandler);
// ignore Ctrl-C
sigignore(SIGINT);
# endif // !WIN32
while (!Actions::ExitMainLoop)
{
try