From 771c2be67b01f26776335f945a44a05d3a510d17 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 19 May 2006 17:06:11 +0000 Subject: - Don't hang on exit on FreeBSD --- ChangeLog | 1 + daemon/httpauthd.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2f456d..6d226ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - Fix problem with NTLM connection caching - Fix problem with NTLM not authenticating POST in IE properly - Better log handling when things are fast and furious + - Don't hang on exit on FreeBSD 0.5 - Added Dummy handler diff --git a/daemon/httpauthd.c b/daemon/httpauthd.c index bff12cb..474af5f 100644 --- a/daemon/httpauthd.c +++ b/daemon/httpauthd.c @@ -432,7 +432,11 @@ int main(int argc, char* argv[]) if(threads[i].tid != 0) { if(threads[i].fd != -1) + { shutdown(threads[i].fd, SHUT_RDWR); + close(threads[i].fd); + threads[i].fd = -1; + } pthread_join(threads[i].tid, NULL); } @@ -503,10 +507,14 @@ static void writepid(const char* pidfile) static void* httpauth_thread(void* arg) { httpauth_thread_t* thread = (httpauth_thread_t*)arg; + sigset_t set; int r; - siginterrupt(SIGINT, 1); - siginterrupt(SIGTERM, 1); + /* We handle these signals on the main thread */ + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGTERM); + pthread_sigmask(SIG_BLOCK, &set, NULL); ASSERT(thread); ASSERT(thread->fd != -1); -- cgit v1.2.3