2013-06-21 19:56:08 +04:00
/*
2007-01-21 11:23:14 +03:00
Unix SMB / CIFS implementation .
common events code for signal events
Copyright ( C ) Andrew Tridgell 2007
2009-02-16 10:52:06 +03:00
* * NOTE ! The following LGPL license applies to the tevent
* * library . This does NOT imply that all of Samba is released
* * under the LGPL
This library is free software ; you can redistribute it and / or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This library is distributed in the hope that it will be useful ,
2007-01-21 11:23:14 +03:00
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2009-02-16 10:52:06 +03:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public
License along with this library ; if not , see < http : //www.gnu.org/licenses/>.
2007-01-21 11:23:14 +03:00
*/
2008-04-25 01:28:30 +04:00
# include "replace.h"
2007-01-21 11:23:14 +03:00
# include "system/filesys.h"
2009-01-02 14:53:05 +03:00
# include "system/wait.h"
2008-12-16 21:57:09 +03:00
# include "tevent.h"
# include "tevent_internal.h"
# include "tevent_util.h"
2007-01-21 11:23:14 +03:00
2009-09-03 18:38:21 +04:00
/* maximum number of SA_SIGINFO signals to hold in the queue.
NB . This * MUST * be a power of 2 , in order for the ring buffer
wrap to work correctly . Thanks to Petr Vandrovec < petr @ vandrovec . name >
for this . */
2013-12-09 13:29:45 +04:00
# define TEVENT_SA_INFO_QUEUE_COUNT 256
2007-01-21 13:32:39 +03:00
2009-12-20 15:59:03 +03:00
struct tevent_sigcounter {
2007-01-22 00:02:24 +03:00
uint32_t count ;
uint32_t seen ;
} ;
2009-12-20 15:59:03 +03:00
# define TEVENT_SIG_INCREMENT(s) (s).count++
# define TEVENT_SIG_SEEN(s, n) (s).seen += (n)
# define TEVENT_SIG_PENDING(s) ((s).seen != (s).count)
2007-01-22 00:02:24 +03:00
2009-01-05 18:55:00 +03:00
struct tevent_common_signal_list {
struct tevent_common_signal_list * prev , * next ;
struct tevent_signal * se ;
} ;
2007-01-22 00:02:24 +03:00
2007-01-21 11:23:14 +03:00
/*
the poor design of signals means that this table must be static global
*/
2009-12-20 15:59:03 +03:00
static struct tevent_sig_state {
struct tevent_common_signal_list * sig_handlers [ TEVENT_NUM_SIGNALS + 1 ] ;
struct sigaction * oldact [ TEVENT_NUM_SIGNALS + 1 ] ;
struct tevent_sigcounter signal_count [ TEVENT_NUM_SIGNALS + 1 ] ;
struct tevent_sigcounter got_signal ;
2007-01-21 13:32:39 +03:00
# ifdef SA_SIGINFO
/* with SA_SIGINFO we get quite a lot of info per signal */
2009-12-20 15:59:03 +03:00
siginfo_t * sig_info [ TEVENT_NUM_SIGNALS + 1 ] ;
struct tevent_sigcounter sig_blocked [ TEVENT_NUM_SIGNALS + 1 ] ;
2007-01-21 13:32:39 +03:00
# endif
2007-01-23 03:06:33 +03:00
} * sig_state ;
2007-01-21 11:23:14 +03:00
2007-01-22 00:02:24 +03:00
/*
return number of sigcounter events not processed yet
*/
2009-12-20 15:59:03 +03:00
static uint32_t tevent_sig_count ( struct tevent_sigcounter s )
2007-01-22 00:02:24 +03:00
{
2009-08-26 12:00:32 +04:00
return s . count - s . seen ;
2007-01-22 00:02:24 +03:00
}
2007-01-21 11:23:14 +03:00
/*
signal handler - redirects to registered signals
*/
2009-01-14 14:07:45 +03:00
static void tevent_common_signal_handler ( int signum )
2007-01-21 11:23:14 +03:00
{
char c = 0 ;
2009-08-28 06:38:47 +04:00
struct tevent_common_signal_list * sl ;
struct tevent_context * ev = NULL ;
2009-09-21 05:16:18 +04:00
int saved_errno = errno ;
2009-08-28 06:38:47 +04:00
2009-12-20 15:59:03 +03:00
TEVENT_SIG_INCREMENT ( sig_state - > signal_count [ signum ] ) ;
TEVENT_SIG_INCREMENT ( sig_state - > got_signal ) ;
2009-08-28 06:38:47 +04:00
/* Write to each unique event context. */
for ( sl = sig_state - > sig_handlers [ signum ] ; sl ; sl = sl - > next ) {
2009-10-02 03:18:33 +04:00
if ( sl - > se - > event_ctx & & sl - > se - > event_ctx ! = ev ) {
2009-09-22 05:02:10 +04:00
ev = sl - > se - > event_ctx ;
2009-08-28 06:38:47 +04:00
/* doesn't matter if this pipe overflows */
2011-11-10 03:46:10 +04:00
( void ) write ( ev - > pipe_fds [ 1 ] , & c , 1 ) ;
2009-08-28 06:38:47 +04:00
}
}
2009-09-21 05:16:18 +04:00
errno = saved_errno ;
2007-01-21 11:23:14 +03:00
}
2007-01-21 13:32:39 +03:00
# ifdef SA_SIGINFO
/*
signal handler with SA_SIGINFO - redirects to registered signals
*/
2009-01-14 14:07:45 +03:00
static void tevent_common_signal_handler_info ( int signum , siginfo_t * info ,
void * uctx )
2007-01-21 13:32:39 +03:00
{
2009-12-20 15:59:03 +03:00
uint32_t count = tevent_sig_count ( sig_state - > signal_count [ signum ] ) ;
/* sig_state->signal_count[signum].seen % TEVENT_SA_INFO_QUEUE_COUNT
2009-08-22 02:07:25 +04:00
* is the base of the unprocessed signals in the ringbuffer . */
uint32_t ofs = ( sig_state - > signal_count [ signum ] . seen + count ) %
2009-12-20 15:59:03 +03:00
TEVENT_SA_INFO_QUEUE_COUNT ;
2009-08-22 02:07:25 +04:00
sig_state - > sig_info [ signum ] [ ofs ] = * info ;
2007-01-21 13:32:39 +03:00
2009-01-14 14:07:45 +03:00
tevent_common_signal_handler ( signum ) ;
2007-01-21 13:32:39 +03:00
/* handle SA_SIGINFO */
2009-12-20 15:59:03 +03:00
if ( count + 1 = = TEVENT_SA_INFO_QUEUE_COUNT ) {
2007-01-21 13:32:39 +03:00
/* we've filled the info array - block this signal until
these ones are delivered */
2013-01-15 03:22:11 +04:00
# ifdef HAVE_UCONTEXT_T
/*
* This is the only way for this to work .
* By default signum is blocked inside this
* signal handler using a temporary mask ,
* but what we really need to do now is
* block it in the callers mask , so it
* stays blocked when the temporary signal
* handler mask is replaced when we return
* from here . The callers mask can be found
* in the ucontext_t passed in as the
* void * uctx argument .
*/
ucontext_t * ucp = ( ucontext_t * ) uctx ;
sigaddset ( & ucp - > uc_sigmask , signum ) ;
# else
/*
* WARNING ! ! ! WARNING ! ! ! !
*
* This code doesn ' t work .
* By default signum is blocked inside this
* signal handler , but calling sigprocmask
* modifies the temporary signal mask being
* used * inside * this handler , which will be
* replaced by the callers signal mask once
* we return from here . See Samba
* bug # 9550 for details .
*/
2007-01-21 13:32:39 +03:00
sigset_t set ;
sigemptyset ( & set ) ;
sigaddset ( & set , signum ) ;
sigprocmask ( SIG_BLOCK , & set , NULL ) ;
2013-01-15 03:22:11 +04:00
# endif
2009-12-20 15:59:03 +03:00
TEVENT_SIG_INCREMENT ( sig_state - > sig_blocked [ signum ] ) ;
2007-01-21 13:32:39 +03:00
}
}
# endif
2007-01-21 11:23:14 +03:00
2009-01-05 18:55:00 +03:00
static int tevent_common_signal_list_destructor ( struct tevent_common_signal_list * sl )
{
2010-02-09 12:02:20 +03:00
if ( sig_state - > sig_handlers [ sl - > se - > signum ] ) {
DLIST_REMOVE ( sig_state - > sig_handlers [ sl - > se - > signum ] , sl ) ;
}
2009-01-05 18:55:00 +03:00
return 0 ;
}
2007-01-21 11:23:14 +03:00
/*
destroy a signal event
*/
2009-01-02 15:26:32 +03:00
static int tevent_signal_destructor ( struct tevent_signal * se )
2007-01-21 11:23:14 +03:00
{
2013-12-05 11:47:27 +04:00
struct tevent_common_signal_list * sl =
talloc_get_type_abort ( se - > additional_data ,
struct tevent_common_signal_list ) ;
2009-01-05 18:55:00 +03:00
if ( se - > event_ctx ) {
2013-07-31 13:31:57 +04:00
struct tevent_context * ev = se - > event_ctx ;
DLIST_REMOVE ( ev - > signal_events , se ) ;
if ( ev - > signal_events = = NULL & & ev - > pipe_fde ! = NULL ) {
/*
* This was the last signal . Destroy the pipe .
*/
TALLOC_FREE ( ev - > pipe_fde ) ;
close ( ev - > pipe_fds [ 0 ] ) ;
close ( ev - > pipe_fds [ 1 ] ) ;
}
2009-01-05 18:55:00 +03:00
}
talloc_free ( sl ) ;
2007-01-23 03:06:33 +03:00
if ( sig_state - > sig_handlers [ se - > signum ] = = NULL ) {
2007-01-21 13:32:39 +03:00
/* restore old handler, if any */
2010-02-09 12:02:20 +03:00
if ( sig_state - > oldact [ se - > signum ] ) {
sigaction ( se - > signum , sig_state - > oldact [ se - > signum ] , NULL ) ;
sig_state - > oldact [ se - > signum ] = NULL ;
}
2007-01-22 01:12:19 +03:00
# ifdef SA_SIGINFO
if ( se - > sa_flags & SA_SIGINFO ) {
2010-02-09 12:02:20 +03:00
if ( sig_state - > sig_info [ se - > signum ] ) {
talloc_free ( sig_state - > sig_info [ se - > signum ] ) ;
sig_state - > sig_info [ se - > signum ] = NULL ;
}
2007-01-22 01:12:19 +03:00
}
# endif
2007-01-21 11:23:14 +03:00
}
2009-01-05 18:55:00 +03:00
2007-01-21 11:23:14 +03:00
return 0 ;
}
/*
this is part of the pipe hack needed to avoid the signal race condition
*/
2008-12-29 22:24:57 +03:00
static void signal_pipe_handler ( struct tevent_context * ev , struct tevent_fd * fde ,
2009-08-24 16:27:13 +04:00
uint16_t flags , void * _private )
2007-01-21 11:23:14 +03:00
{
char c [ 16 ] ;
/* its non-blocking, doesn't matter if we read too much */
2011-11-10 03:46:10 +04:00
( void ) read ( fde - > fd , c , sizeof ( c ) ) ;
2007-01-21 11:23:14 +03:00
}
/*
add a signal event
return NULL on failure ( memory allocation error )
*/
2009-01-02 15:26:32 +03:00
struct tevent_signal * tevent_common_add_signal ( struct tevent_context * ev ,
TALLOC_CTX * mem_ctx ,
int signum ,
int sa_flags ,
tevent_signal_handler_t handler ,
void * private_data ,
const char * handler_name ,
const char * location )
2007-01-21 11:23:14 +03:00
{
2009-01-02 15:26:32 +03:00
struct tevent_signal * se ;
2009-01-05 18:55:00 +03:00
struct tevent_common_signal_list * sl ;
2009-08-28 06:38:47 +04:00
sigset_t set , oldset ;
2007-01-21 11:23:14 +03:00
2009-12-20 15:59:03 +03:00
if ( signum > = TEVENT_NUM_SIGNALS ) {
2009-01-05 18:55:00 +03:00
errno = EINVAL ;
2007-01-21 11:23:14 +03:00
return NULL ;
}
2007-01-23 03:06:33 +03:00
/* the sig_state needs to be on a global context as it can last across
multiple event contexts */
if ( sig_state = = NULL ) {
2010-09-24 21:13:05 +04:00
sig_state = talloc_zero ( NULL , struct tevent_sig_state ) ;
2007-01-23 03:06:33 +03:00
if ( sig_state = = NULL ) {
return NULL ;
}
}
2009-01-02 15:26:32 +03:00
se = talloc ( mem_ctx ? mem_ctx : ev , struct tevent_signal ) ;
2007-01-21 11:23:14 +03:00
if ( se = = NULL ) return NULL ;
se - > event_ctx = ev ;
se - > signum = signum ;
2007-01-21 13:32:39 +03:00
se - > sa_flags = sa_flags ;
2009-01-02 15:26:32 +03:00
se - > handler = handler ;
se - > private_data = private_data ;
se - > handler_name = handler_name ;
se - > location = location ;
se - > additional_data = NULL ;
2009-01-05 18:55:00 +03:00
sl = talloc ( se , struct tevent_common_signal_list ) ;
if ( ! sl ) {
talloc_free ( se ) ;
return NULL ;
}
sl - > se = se ;
se - > additional_data = sl ;
2007-01-24 01:28:21 +03:00
/* Ensure, no matter the destruction order, that we always have a handle on the global sig_state */
if ( ! talloc_reference ( se , sig_state ) ) {
2009-01-05 18:55:00 +03:00
talloc_free ( se ) ;
2007-01-24 01:28:21 +03:00
return NULL ;
}
2007-01-21 11:23:14 +03:00
2009-08-28 06:34:22 +04:00
/* we need to setup the pipe hack handler if not already
setup */
if ( ev - > pipe_fde = = NULL ) {
2009-08-28 06:38:47 +04:00
if ( pipe ( ev - > pipe_fds ) = = - 1 ) {
talloc_free ( se ) ;
return NULL ;
2009-08-28 06:34:22 +04:00
}
2009-08-28 06:38:47 +04:00
ev_set_blocking ( ev - > pipe_fds [ 0 ] , false ) ;
ev_set_blocking ( ev - > pipe_fds [ 1 ] , false ) ;
ev - > pipe_fde = tevent_add_fd ( ev , ev , ev - > pipe_fds [ 0 ] ,
TEVENT_FD_READ ,
signal_pipe_handler , NULL ) ;
2009-08-28 06:34:22 +04:00
if ( ! ev - > pipe_fde ) {
2009-08-28 06:38:47 +04:00
close ( ev - > pipe_fds [ 0 ] ) ;
close ( ev - > pipe_fds [ 1 ] ) ;
2009-08-28 06:34:22 +04:00
talloc_free ( se ) ;
return NULL ;
}
}
2007-01-21 13:32:39 +03:00
/* only install a signal handler if not already installed */
2007-01-23 03:06:33 +03:00
if ( sig_state - > sig_handlers [ signum ] = = NULL ) {
2007-01-21 13:32:39 +03:00
struct sigaction act ;
ZERO_STRUCT ( act ) ;
2009-01-14 14:07:45 +03:00
act . sa_handler = tevent_common_signal_handler ;
2007-01-21 13:32:39 +03:00
act . sa_flags = sa_flags ;
# ifdef SA_SIGINFO
if ( sa_flags & SA_SIGINFO ) {
act . sa_handler = NULL ;
2009-01-14 14:07:45 +03:00
act . sa_sigaction = tevent_common_signal_handler_info ;
2007-01-23 03:06:33 +03:00
if ( sig_state - > sig_info [ signum ] = = NULL ) {
2009-12-20 15:59:03 +03:00
sig_state - > sig_info [ signum ] =
talloc_zero_array ( sig_state , siginfo_t ,
TEVENT_SA_INFO_QUEUE_COUNT ) ;
2007-01-23 03:06:33 +03:00
if ( sig_state - > sig_info [ signum ] = = NULL ) {
2007-01-22 01:12:19 +03:00
talloc_free ( se ) ;
return NULL ;
}
}
2007-01-21 13:32:39 +03:00
}
# endif
2007-01-23 03:06:33 +03:00
sig_state - > oldact [ signum ] = talloc ( sig_state , struct sigaction ) ;
if ( sig_state - > oldact [ signum ] = = NULL ) {
2007-01-22 01:12:19 +03:00
talloc_free ( se ) ;
2013-06-21 19:56:08 +04:00
return NULL ;
2007-01-22 01:12:19 +03:00
}
2007-01-23 03:06:33 +03:00
if ( sigaction ( signum , & act , sig_state - > oldact [ signum ] ) = = - 1 ) {
2007-01-21 13:32:39 +03:00
talloc_free ( se ) ;
return NULL ;
}
2007-01-21 11:23:14 +03:00
}
2009-01-05 18:55:00 +03:00
DLIST_ADD ( se - > event_ctx - > signal_events , se ) ;
2009-08-28 06:38:47 +04:00
/* Make sure the signal doesn't come in while we're mangling list. */
sigemptyset ( & set ) ;
sigaddset ( & set , signum ) ;
sigprocmask ( SIG_BLOCK , & set , & oldset ) ;
2009-01-05 18:55:00 +03:00
DLIST_ADD ( sig_state - > sig_handlers [ signum ] , sl ) ;
2009-08-28 06:38:47 +04:00
sigprocmask ( SIG_SETMASK , & oldset , NULL ) ;
2007-01-21 11:23:14 +03:00
2009-01-02 15:26:32 +03:00
talloc_set_destructor ( se , tevent_signal_destructor ) ;
2009-01-05 18:55:00 +03:00
talloc_set_destructor ( sl , tevent_common_signal_list_destructor ) ;
2007-01-21 11:23:14 +03:00
return se ;
}
2012-01-29 01:18:00 +04:00
struct tevent_se_exists {
struct tevent_se_exists * * myself ;
} ;
static int tevent_se_exists_destructor ( struct tevent_se_exists * s )
{
* s - > myself = NULL ;
return 0 ;
}
2007-01-21 11:23:14 +03:00
/*
check if a signal is pending
return ! = 0 if a signal was pending
*/
2009-01-02 15:26:32 +03:00
int tevent_common_check_signal ( struct tevent_context * ev )
2007-01-21 11:23:14 +03:00
{
int i ;
2007-01-23 03:06:33 +03:00
2009-12-20 15:59:03 +03:00
if ( ! sig_state | | ! TEVENT_SIG_PENDING ( sig_state - > got_signal ) ) {
2007-01-21 11:23:14 +03:00
return 0 ;
}
2013-06-21 19:56:08 +04:00
2009-12-20 15:59:03 +03:00
for ( i = 0 ; i < TEVENT_NUM_SIGNALS + 1 ; i + + ) {
2009-01-05 18:55:00 +03:00
struct tevent_common_signal_list * sl , * next ;
2009-12-20 15:59:03 +03:00
struct tevent_sigcounter counter = sig_state - > signal_count [ i ] ;
uint32_t count = tevent_sig_count ( counter ) ;
2009-08-22 02:07:25 +04:00
# ifdef SA_SIGINFO
/* Ensure we null out any stored siginfo_t entries
* after processing for debugging purposes . */
bool clear_processed_siginfo = false ;
# endif
2007-01-21 20:58:56 +03:00
if ( count = = 0 ) {
continue ;
}
2009-01-05 18:55:00 +03:00
for ( sl = sig_state - > sig_handlers [ i ] ; sl ; sl = next ) {
struct tevent_signal * se = sl - > se ;
2012-01-29 01:18:00 +04:00
struct tevent_se_exists * exists ;
2012-02-15 19:17:34 +04:00
next = sl - > next ;
2012-01-29 01:18:00 +04:00
/*
* We have to be careful to not touch " se "
* after it was deleted in its handler . Thus
* we allocate a child whose destructor will
* tell by nulling out itself that its parent
* is gone .
*/
exists = talloc ( se , struct tevent_se_exists ) ;
if ( exists = = NULL ) {
continue ;
}
exists - > myself = & exists ;
talloc_set_destructor (
exists , tevent_se_exists_destructor ) ;
2007-01-21 13:32:39 +03:00
# ifdef SA_SIGINFO
2007-01-21 20:58:56 +03:00
if ( se - > sa_flags & SA_SIGINFO ) {
2009-08-22 02:07:25 +04:00
uint32_t j ;
clear_processed_siginfo = true ;
2007-01-21 20:58:56 +03:00
for ( j = 0 ; j < count ; j + + ) {
2009-08-22 02:07:25 +04:00
/* sig_state->signal_count[i].seen
2009-12-20 15:59:03 +03:00
* % TEVENT_SA_INFO_QUEUE_COUNT is
2009-08-22 02:07:25 +04:00
* the base position of the unprocessed
* signals in the ringbuffer . */
uint32_t ofs = ( counter . seen + j )
2009-12-20 15:59:03 +03:00
% TEVENT_SA_INFO_QUEUE_COUNT ;
2009-08-22 02:07:25 +04:00
se - > handler ( ev , se , i , 1 ,
2013-06-21 19:56:08 +04:00
( void * ) & sig_state - > sig_info [ i ] [ ofs ] ,
2007-01-21 20:58:56 +03:00
se - > private_data ) ;
2012-01-29 01:18:00 +04:00
if ( ! exists ) {
break ;
}
2007-01-21 13:32:39 +03:00
}
2011-08-01 22:49:10 +04:00
# ifdef SA_RESETHAND
2012-01-29 01:18:00 +04:00
if ( exists & & ( se - > sa_flags & SA_RESETHAND ) ) {
2007-01-22 01:14:05 +03:00
talloc_free ( se ) ;
}
2011-08-01 22:49:10 +04:00
# endif
2012-01-29 01:18:00 +04:00
talloc_free ( exists ) ;
2007-01-21 20:58:56 +03:00
continue ;
}
# endif
se - > handler ( ev , se , i , count , NULL , se - > private_data ) ;
2011-08-01 22:49:10 +04:00
# ifdef SA_RESETHAND
2012-01-29 01:18:00 +04:00
if ( exists & & ( se - > sa_flags & SA_RESETHAND ) ) {
2007-01-21 20:58:56 +03:00
talloc_free ( se ) ;
2007-01-21 11:23:14 +03:00
}
2011-08-01 22:49:10 +04:00
# endif
2012-01-29 01:18:00 +04:00
talloc_free ( exists ) ;
2007-01-21 11:23:14 +03:00
}
2009-08-22 02:07:25 +04:00
# ifdef SA_SIGINFO
if ( clear_processed_siginfo ) {
uint32_t j ;
for ( j = 0 ; j < count ; j + + ) {
uint32_t ofs = ( counter . seen + j )
2009-12-20 15:59:03 +03:00
% TEVENT_SA_INFO_QUEUE_COUNT ;
2009-08-22 02:07:25 +04:00
memset ( ( void * ) & sig_state - > sig_info [ i ] [ ofs ] ,
' \0 ' ,
sizeof ( siginfo_t ) ) ;
}
}
# endif
2009-12-20 15:59:03 +03:00
TEVENT_SIG_SEEN ( sig_state - > signal_count [ i ] , count ) ;
TEVENT_SIG_SEEN ( sig_state - > got_signal , count ) ;
2009-08-22 02:07:25 +04:00
# ifdef SA_SIGINFO
2009-12-20 15:59:03 +03:00
if ( TEVENT_SIG_PENDING ( sig_state - > sig_blocked [ i ] ) ) {
2009-08-22 02:07:25 +04:00
/* We'd filled the queue, unblock the
signal now the queue is empty again .
Note we MUST do this after the
2009-12-20 15:59:03 +03:00
TEVENT_SIG_SEEN ( sig_state - > signal_count [ i ] , count )
2009-08-22 02:07:25 +04:00
call to prevent a new signal running
out of room in the sig_state - > sig_info [ i ] [ ]
ring buffer . */
sigset_t set ;
sigemptyset ( & set ) ;
sigaddset ( & set , i ) ;
2009-12-20 15:59:03 +03:00
TEVENT_SIG_SEEN ( sig_state - > sig_blocked [ i ] ,
tevent_sig_count ( sig_state - > sig_blocked [ i ] ) ) ;
2009-08-22 02:07:25 +04:00
sigprocmask ( SIG_UNBLOCK , & set , NULL ) ;
}
# endif
2007-01-21 11:23:14 +03:00
}
return 1 ;
}
2010-02-09 12:02:20 +03:00
void tevent_cleanup_pending_signal_handlers ( struct tevent_signal * se )
{
2013-12-05 11:47:27 +04:00
struct tevent_common_signal_list * sl =
talloc_get_type_abort ( se - > additional_data ,
struct tevent_common_signal_list ) ;
2010-02-09 12:02:20 +03:00
tevent_common_signal_list_destructor ( sl ) ;
if ( sig_state - > sig_handlers [ se - > signum ] = = NULL ) {
if ( sig_state - > oldact [ se - > signum ] ) {
sigaction ( se - > signum , sig_state - > oldact [ se - > signum ] , NULL ) ;
sig_state - > oldact [ se - > signum ] = NULL ;
}
}
return ;
}