From 9e6b8533f1606fdc2535aad88817b50b8e4ad663 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 31 Oct 2014 12:10:58 +0100 Subject: [PATCH] ncmpcpp: ignore SIGPIPE --- src/ncmpcpp.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 08764011..1dfcea46 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -58,11 +58,7 @@ namespace # if !defined(WIN32) void sighandler(int sig) { - if (sig == SIGPIPE) - { - Statusbar::print("SIGPIPE (broken pipe signal) received"); - } - else if (sig == SIGWINCH) + if (sig == SIGWINCH) { run_resize_screen = true; } @@ -147,8 +143,11 @@ int main(int argc, char **argv) mousemask(ALL_MOUSE_EVENTS, 0); # ifndef WIN32 - signal(SIGPIPE, 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 while (!Actions::ExitMainLoop)