From 72e09527b975ba04d36708d78a9d544375ce2671 Mon Sep 17 00:00:00 2001 From: Frank Rolsted Jensen Date: Wed, 4 Jun 2025 11:43:25 +0200 Subject: [PATCH] Handling of pthread_mutex_init failure fixed pthread_mutex_init() returns errno on failure --- src/ttynvt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ttynvt.c b/src/ttynvt.c index 32229bf..333ae8a 100644 --- a/src/ttynvt.c +++ b/src/ttynvt.c @@ -476,8 +476,8 @@ static void ttynvt_open(fuse_req_t req, struct fuse_file_info *info) goto open_err; } - if ((res = pthread_mutex_init(&tty->tty_lock, NULL) < 0) || - (res = pthread_mutex_init(&tty->poll_lock, NULL) < 0) || + if ((res = pthread_mutex_init(&tty->tty_lock, NULL)) || + (res = pthread_mutex_init(&tty->poll_lock, NULL)) || (res = pthread_create(&tty->ptid_poll, NULL, &_read_net, tty))) { errno = res;