diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-15 17:14:26 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-15 17:14:26 +0200 |
commit | 7d54db53955ab7adf20e78c260507beedde4d9f5 (patch) | |
tree | 2eafdac730141c2a07fb2f8722b191c8c9b1f8b3 | |
parent | cmake: disable -Werror for debug builds (diff) | |
download | cimple-7d54db53955ab7adf20e78c260507beedde4d9f5.tar.gz cimple-7d54db53955ab7adf20e78c260507beedde4d9f5.zip |
worker_queue: forgot to close file descriptors in worker_destroy
-rw-r--r-- | src/worker_queue.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/worker_queue.c b/src/worker_queue.c index 3e207e3..06119e2 100644 --- a/src/worker_queue.c +++ b/src/worker_queue.c @@ -11,6 +11,7 @@ #include <pthread.h> #include <stdlib.h> #include <sys/queue.h> +#include <unistd.h> struct worker { pthread_t thread; @@ -37,6 +38,7 @@ void worker_destroy(struct worker *entry) { log("Waiting for worker %d thread to exit\n", entry->fd); pthread_errno_if(pthread_join(entry->thread, NULL), "pthread_join"); + log_errno_if(close(entry->fd), "close"); free(entry); } |