diff options
author | Stef Walter <stef@memberwebs.com> | 2006-05-19 17:06:11 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-05-19 17:06:11 +0000 |
commit | 771c2be67b01f26776335f945a44a05d3a510d17 (patch) | |
tree | 435cce12ec203f58d034010cf9f48f39c4be045c /daemon | |
parent | 41ecc7c08a82accbbd539e2dfd7abb5c496eda03 (diff) |
- Don't hang on exit on FreeBSD
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/httpauthd.c | 12 |
1 files changed, 10 insertions, 2 deletions
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); |