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

1
NEWS
View File

@@ -2,6 +2,7 @@ ncmpcpp-0.6.4 (????-??-??)
* Fix title of a pop-up which shows during adding selected items to the current playlist.
* Correctly deal with leading separator while parsing filenames in tag editor.
* Fix initial incorrect window size that was occuring in some cases.
ncmpcpp-0.6.3 (2015-03-02)

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