From 6bad2355ef8d7a4013a73888416c8a90e6b6dab0 Mon Sep 17 00:00:00 2001 From: default Date: Mon, 8 May 2023 09:17:00 +0200 Subject: [PATCH] Moved sem_close() further to the end. --- httpd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/httpd.c b/httpd.c index 334d73d..e8223f5 100644 --- a/httpd.c +++ b/httpd.c @@ -354,10 +354,6 @@ void job_wait(xs_val **job) /* unlock the mutex */ pthread_mutex_unlock(&job_mutex); } - - if (!*job) { - sem_close(job_sem); - } } @@ -568,5 +564,7 @@ void httpd(void) job_fifo = xs_free(job_fifo); pthread_mutex_unlock(&job_mutex); + sem_close(job_sem); + srv_log(xs_fmt("httpd stop %s:%d", address, port)); }