Module: ngircd.git Branch: master Commit: 57a2faf4a74c65a6f12caf2d69c34e4f08c659f9 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=57a2f...
Author: Alexander Barton alex@barton.de Date: Tue Jul 13 22:04:35 2010 +0200
Use Proc_GenericSignalHandler() as handler for SIGTERM by default
---
src/ngircd/irc-login.c | 1 - src/ngircd/proc.c | 1 + src/ngircd/resolve.c | 16 ++-------------- 3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 0789540..0bcbe3e 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -785,7 +785,6 @@ Hello_User(CLIENT * Client) return CONNECTED; } else { /* Sub process */ - signal(SIGTERM, Proc_GenericSignalHandler); Log_Init_Subprocess("Auth"); if (Conf_NoPAM) { result = (Client_Password(Client)[0] == '\0'); diff --git a/src/ngircd/proc.c b/src/ngircd/proc.c index f543883..11cb039 100644 --- a/src/ngircd/proc.c +++ b/src/ngircd/proc.c @@ -66,6 +66,7 @@ Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc)(int, short)) return -1; case 0: /* New child process: */ + signal(SIGTERM, Proc_GenericSignalHandler); close(pipefds[0]); return 0; } diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index 808ce53..b88ec11 100644 --- a/src/ngircd/resolve.c +++ b/src/ngircd/resolve.c @@ -42,7 +42,6 @@ #include "io.h"
-static void Init_Subprocess PARAMS(( void )); static void Do_ResolveAddr PARAMS(( const ng_ipaddr_t *Addr, int Sock, int w_fd )); static void Do_ResolveName PARAMS(( const char *Host, int w_fd ));
@@ -70,7 +69,7 @@ Resolve_Addr(PROC_STAT * s, const ng_ipaddr_t *Addr, int identsock, return true; } else if( pid == 0 ) { /* Sub process */ - Init_Subprocess(); + Log_Init_Subprocess("Resolver"); Do_ResolveAddr( Addr, identsock, pipefd[1]); Log_Exit_Subprocess("Resolver"); exit(0); @@ -99,7 +98,7 @@ Resolve_Name( PROC_STAT *s, const char *Host, void (*cbfunc)(int, short)) return true; } else if( pid == 0 ) { /* Sub process */ - Init_Subprocess(); + Log_Init_Subprocess("Resolver"); Do_ResolveName(Host, pipefd[1]); Log_Exit_Subprocess("Resolver"); exit(0); @@ -108,17 +107,6 @@ Resolve_Name( PROC_STAT *s, const char *Host, void (*cbfunc)(int, short)) } /* Resolve_Name */
-/** - * Initialize forked resolver subprocess. - */ -static void -Init_Subprocess(void) -{ - signal(SIGTERM, Proc_GenericSignalHandler); - Log_Init_Subprocess("Resolver"); -} - - #if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO) #if !defined(WANT_IPV6) && defined(h_errno) static char *
ngircd-commits@lists.barton.de