From 44913c1e0e464fe60b040115edfdd3491d94e769 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 15 Dec 2022 19:55:52 +0100 Subject: [PATCH] Refactor --- src/lib/compress.h | 6 ++---- src/logger.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/compress.h b/src/lib/compress.h index 16c659a..e9db34a 100644 --- a/src/lib/compress.h +++ b/src/lib/compress.h @@ -27,11 +27,9 @@ typedef struct { int compress_init(compress_ctx *ctx, int mode); -int compress_compress(compress_ctx *ctx, const char *in, unsigned long *in_len, char *out, unsigned long *out_len, - int finish); +int compress_compress(compress_ctx *ctx, const char *in, unsigned long *in_len, char *out, unsigned long *out_len, int finish); -int compress_compress_mode(compress_ctx *ctx, int mode, const char *in, unsigned long *in_len, char *out, - unsigned long *out_len, int finish); +int compress_compress_mode(compress_ctx *ctx, int mode, const char *in, unsigned long *in_len, char *out, unsigned long *out_len, int finish); int compress_free(compress_ctx *ctx); diff --git a/src/logger.c b/src/logger.c index 7bcac0e..54e152f 100644 --- a/src/logger.c +++ b/src/logger.c @@ -153,7 +153,7 @@ static int logger_init(void) { int ret; // try to initialize all three semaphores - if (sem_init(&sem_buf, 0, 1) != 0 || sem_init(&sem_buf_free, 0, 1) != 0 || sem_init(&sem_buf_used, 0, 0) != 0) { + if (sem_init(&sem_buf, 0, 1) != 0 || sem_init(&sem_buf_free, 0, LOG_BUF_SIZE) != 0 || sem_init(&sem_buf_used, 0, 0) != 0) { err("Unable to initialize semaphore"); logger_destroy(); return -1;