Refactor
This commit is contained in:
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user