summaryrefslogtreecommitdiff
path: root/daemon/httpauthd.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/httpauthd.c')
-rw-r--r--daemon/httpauthd.c12
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);