Always remove the alarm before changing the handler, not the other way around.
authorJeremy Allison <jra@samba.org>
Sat, 20 Aug 2011 03:55:41 +0000 (20:55 -0700)
committerJeremy Allison <jra@samba.org>
Sat, 20 Aug 2011 03:55:41 +0000 (20:55 -0700)
source3/lib/smbldap.c

index 7410620c6db1c816cc98aac94ec70356a24ad8d9..fc4dff576450e37c3725fee481550279e9ae11e5 100644 (file)
@@ -1410,8 +1410,8 @@ static int another_ldap_try(struct smbldap_state *ldap_state, int *rc,
        }
 
  no_next:
-       CatchSignal(SIGALRM, SIG_IGN);
        alarm(0);
+       CatchSignal(SIGALRM, SIG_IGN);
        ldap_state->last_use = now;
        return False;
 }