ncmpcpp: ignore SIGPIPE
This commit is contained in:
@@ -58,11 +58,7 @@ namespace
|
|||||||
# if !defined(WIN32)
|
# if !defined(WIN32)
|
||||||
void sighandler(int sig)
|
void sighandler(int sig)
|
||||||
{
|
{
|
||||||
if (sig == SIGPIPE)
|
if (sig == SIGWINCH)
|
||||||
{
|
|
||||||
Statusbar::print("SIGPIPE (broken pipe signal) received");
|
|
||||||
}
|
|
||||||
else if (sig == SIGWINCH)
|
|
||||||
{
|
{
|
||||||
run_resize_screen = true;
|
run_resize_screen = true;
|
||||||
}
|
}
|
||||||
@@ -147,8 +143,11 @@ int main(int argc, char **argv)
|
|||||||
mousemask(ALL_MOUSE_EVENTS, 0);
|
mousemask(ALL_MOUSE_EVENTS, 0);
|
||||||
|
|
||||||
# ifndef WIN32
|
# ifndef WIN32
|
||||||
signal(SIGPIPE, sighandler);
|
|
||||||
signal(SIGWINCH, sighandler);
|
signal(SIGWINCH, sighandler);
|
||||||
|
// we get it after connection with mpd is broken.
|
||||||
|
// just ignore it and wait for the connection to
|
||||||
|
// be reestablished.
|
||||||
|
sigignore(SIGPIPE);
|
||||||
# endif // !WIN32
|
# endif // !WIN32
|
||||||
|
|
||||||
while (!Actions::ExitMainLoop)
|
while (!Actions::ExitMainLoop)
|
||||||
|
|||||||
Reference in New Issue
Block a user