Handling of pthread_mutex_init failure fixed
pthread_mutex_init() returns errno on failure
This commit is contained in:
+2
-2
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user