diff --git a/dict.h b/dict.h index d6dc5d9..ed2d89b 100644 --- a/dict.h +++ b/dict.h @@ -95,7 +95,7 @@ static int init_dict(char* file_path, pthread_rwlock_t* mu) { static FILE* open_dict(uint8_t lock_type, uint32_t index, pthread_rwlock_t* mu) { if(lock_type & DICT_LOCK_EX) { - if(pthread_rwlock_trywrlock(mu)) { + if(pthread_rwlock_wrlock(mu)) { puts("Open dict: Writelock busy"); return NULL; } diff --git a/server.c b/server.c index 9cd3c1e..4ff8db4 100644 --- a/server.c +++ b/server.c @@ -435,7 +435,7 @@ static void handle_int(int signo) { } static void handle_pipe(int signo) { - fprintf(stderr, "Pipe error: %d\n", signo); + puts("Pipe error, exit thread..."); pthread_exit(NULL); }