summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-05-19 17:06:11 +0000
committerStef Walter <stef@memberwebs.com>2006-05-19 17:06:11 +0000
commit771c2be67b01f26776335f945a44a05d3a510d17 (patch)
tree435cce12ec203f58d034010cf9f48f39c4be045c
parent41ecc7c08a82accbbd539e2dfd7abb5c496eda03 (diff)
- Don't hang on exit on FreeBSD
-rw-r--r--ChangeLog1
-rw-r--r--daemon/httpauthd.c12
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);