Handling of pthread_mutex_init failure fixed

pthread_mutex_init() returns errno on failure
This commit is contained in:
Frank Rolsted Jensen
2025-06-04 11:43:25 +02:00
parent 10d5c9cf3b
commit 72e09527b9
+2 -2
View File
@@ -476,8 +476,8 @@ static void ttynvt_open(fuse_req_t req, struct fuse_file_info *info)
goto open_err; goto open_err;
} }
if ((res = pthread_mutex_init(&tty->tty_lock, NULL) < 0) || if ((res = pthread_mutex_init(&tty->tty_lock, NULL)) ||
(res = pthread_mutex_init(&tty->poll_lock, NULL) < 0) || (res = pthread_mutex_init(&tty->poll_lock, NULL)) ||
(res = pthread_create(&tty->ptid_poll, NULL, &_read_net, tty))) (res = pthread_create(&tty->ptid_poll, NULL, &_read_net, tty)))
{ {
errno = res; errno = res;