ITS#6037: save/restore errno in signal handlers

This commit is contained in:
Hallvard Furuseth 2009-03-26 22:11:06 +00:00
parent 9309eb4b34
commit 1e470657b2

View File

@ -2759,6 +2759,8 @@ sockdestroy( void )
RETSIGTYPE
slap_sig_shutdown( int sig )
{
int save_errno = errno;
#if 0
Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: signal %d\n", sig, 0, 0);
#endif
@ -2787,15 +2789,21 @@ slap_sig_shutdown( int sig )
/* reinstall self */
(void) SIGNAL_REINSTALL( sig, slap_sig_shutdown );
errno = save_errno;
}
RETSIGTYPE
slap_sig_wake( int sig )
{
int save_errno = errno;
WAKE_LISTENER(1);
/* reinstall self */
(void) SIGNAL_REINSTALL( sig, slap_sig_wake );
errno = save_errno;
}