commit 57a2faf4a74c65a6f12caf2d69c34e4f08c659f9 from: Alexander Barton date: Tue Jul 13 20:04:35 2010 UTC Use Proc_GenericSignalHandler() as handler for SIGTERM by default commit - 41034950d9cb6bdfc14abe99bf080058189d8933 commit + 57a2faf4a74c65a6f12caf2d69c34e4f08c659f9 blob - 078954024a887bf1495ee8a0672e01530c93359f blob + 0bcbe3edc5b45ec0e36f8124137dc96872892353 --- src/ngircd/irc-login.c +++ 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'); blob - f5438834c1842fa3453b6cc6da62a817e3fd9042 blob + 11cb0396644548387926407913f09530e3373dcd --- src/ngircd/proc.c +++ src/ngircd/proc.c @@ -66,6 +66,7 @@ Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc return -1; case 0: /* New child process: */ + signal(SIGTERM, Proc_GenericSignalHandler); close(pipefds[0]); return 0; } blob - 808ce53f55ed0e1e6d13c6fc82ebb90ecc0d1edd blob + b88ec11ce6bfa53135f543003590b37e30f3c4b7 --- src/ngircd/resolve.c +++ 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, i 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,24 +98,13 @@ Resolve_Name( PROC_STAT *s, const char *Host, void (*c 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); } return false; } /* 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)