Edit

IABSD.fr/ports/audio/ncmpcpp/patches/patch-src_ncmpcpp_cpp

Branch :

  • Show log

    Commit

  • Author : dcoppa
    Date : 2015-12-17 10:10:20
    Hash : 2abb6f3e
    Message : Further improvements, and put sigignore into the anonymous namespace (for the sake of consistency)

  • audio/ncmpcpp/patches/patch-src_ncmpcpp_cpp
  • $OpenBSD: patch-src_ncmpcpp_cpp,v 1.11 2015/12/17 10:10:20 dcoppa Exp $
    
    OpenBSD lacks sigignore(), use the one from NetBSD
    
    --- src/ncmpcpp.cpp.orig	Sun Nov 22 18:30:58 2015
    +++ src/ncmpcpp.cpp	Thu Dec 10 09:38:14 2015
    @@ -68,6 +68,18 @@ namespace
     #		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 buffer
    @@ -108,7 +120,7 @@ int main(int argc, char **argv)
     	signal(SIGPIPE, sighandler);
     	signal(SIGWINCH, sighandler);
     	// ignore Ctrl-C
    -	sigignore(SIGINT);
    +	n_sigignore(SIGINT);
     #	endif // !WIN32
     
     	NC::initScreen(Config.colors_enabled, Config.mouse_support);