summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-08-19 20:54:41 -0700
committerJeremy Allison <jra@samba.org>2011-08-19 20:54:41 -0700
commitec07aca7d5257d997137b1771593a1e1ead51534 (patch)
tree502d9f4fb4c7ce41015e3c07badb05d7071f92b9
parent7cbcbee484e2f4c4a2bb6a8c14cef86508f53a69 (diff)
downloadsamba-ec07aca7d5257d997137b1771593a1e1ead51534.tar.gz
samba-ec07aca7d5257d997137b1771593a1e1ead51534.tar.bz2
samba-ec07aca7d5257d997137b1771593a1e1ead51534.zip
Remove old_handler as alarms can't be nested. Use SIG_IGN instead.
-rw-r--r--source3/lib/smbldap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index ba23281f74..7410620c6d 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;