X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=apc_signal.c;h=7db2ef9e72165769b3e0268753bb7a9bc8d05c18;hb=10aea07a14325aa0bfb5fe75ddcf19432c6e2c64;hp=406fc475c58df5bcafae5f580e68d123f4df3763;hpb=022d24cac1c0c7f210ff5d4723d44b682b8fbf0e;p=php5-apc.git diff --git a/apc_signal.c b/apc_signal.c index 406fc47..7db2ef9 100644 --- a/apc_signal.c +++ b/apc_signal.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ - | Copyright (c) 2006 The PHP Group | + | Copyright (c) 2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -24,7 +24,7 @@ All other licensing and usage conditions are those of the PHP Group. */ - /* $Id: apc_signal.c,v 1.2 2007/12/26 22:38:43 rasmus Exp $ */ + /* $Id: apc_signal.c,v 1.2.2.3 2008/05/11 18:57:00 rasmus Exp $ */ /* Allows apc to install signal handlers and maintain signalling to already registered handlers. Registers all signals that @@ -88,7 +88,7 @@ static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context) static int apc_register_signal(int signo, void (*handler)(int, siginfo_t*, void*)) { #if HAVE_SIGACTION - struct sigaction sa = {0}; + struct sigaction sa = {{0}}; apc_signal_entry_t p_sig = {0}; if (sigaction(signo, NULL, &sa) == 0) { @@ -168,6 +168,20 @@ void apc_set_signals(TSRMLS_D) } } /* }}} */ +/* {{{ apc_set_signals + * cleanup signals for shutdown */ +void apc_shutdown_signals() +{ + int i=0; + if (apc_signal_info.installed > 0) { + for (i=0; (i < apc_signal_info.installed); i++) { + apc_efree(apc_signal_info.prev[i]); + } + apc_efree(apc_signal_info.prev); + apc_signal_info.installed = 0; /* just in case */ + } +} + /* * Local variables: * tab-width: 4