$OpenBSD: patch-src_ncmpcpp_cpp,v 1.13 2017/06/09 15:09:51 dcoppa Exp $

OpenBSD lacks sigignore(), use the one from NetBSD

Index: src/ncmpcpp.cpp
--- src/ncmpcpp.cpp.orig
+++ src/ncmpcpp.cpp
@@ -68,6 +68,18 @@ void sighandler(int sig)
 #endif // __sun && __SVR4
 }
 
+int n_sigignore(int sig)
+{
+	struct sigaction sa;
+
+	sa.sa_handler = SIG_IGN;
+	if (sigemptyset(&sa.sa_mask) != 0)
+		return (-1);
+	sa.sa_flags = 0;
+
+	return (sigaction(sig, &sa, NULL));
+}
+
 void do_at_exit()
 {
 	// restore old cerr & clog buffers
@@ -108,7 +120,7 @@ int main(int argc, char **argv)
 	cerr_buffer = std::cerr.rdbuf();
 	std::cerr.rdbuf(errorlog.rdbuf());
 	
-	sigignore(SIGPIPE);
+	n_sigignore(SIGPIPE);
 	signal(SIGWINCH, sighandler);
 
 	Mpd.setNoidleCallback(Status::update);
