From ec07aca7d5257d997137b1771593a1e1ead51534 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Aug 2011 20:54:41 -0700 Subject: [PATCH] Remove old_handler as alarms can't be nested. Use SIG_IGN instead. --- source3/lib/smbldap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index ba23281f744..7410620c6db 100644 --- a/source3/lib/smbldap.c +++ b/source3/lib/smbldap.c @@ -1347,8 +1347,6 @@ static NTSTATUS smbldap_close(struct smbldap_state *ldap_state) static SIG_ATOMIC_T got_alarm; -static void (*old_handler)(int); - static void gotalarm_sig(int dummy) { got_alarm = 1; @@ -1371,7 +1369,7 @@ static int another_ldap_try(struct smbldap_state *ldap_state, int *rc, if (*attempts == 0) { got_alarm = 0; - old_handler = CatchSignal(SIGALRM, gotalarm_sig); + CatchSignal(SIGALRM, gotalarm_sig); alarm(endtime - now); if (ldap_state->pid != sys_getpid()) @@ -1412,7 +1410,7 @@ static int another_ldap_try(struct smbldap_state *ldap_state, int *rc, } no_next: - CatchSignal(SIGALRM, old_handler); + CatchSignal(SIGALRM, SIG_IGN); alarm(0); ldap_state->last_use = now; return False; -- 2.11.4.GIT