diff --git a/src/unix/fs.c b/src/unix/fs.c index d593d2ec..3f5cd6aa 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -630,7 +630,9 @@ static ssize_t uv__fs_write(uv_fs_t* req) { */ #if defined(__APPLE__) static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_lock(&lock); + + if (pthread_mutex_lock(&lock)) + abort(); #endif if (req->off < 0) { @@ -687,7 +689,8 @@ static ssize_t uv__fs_write(uv_fs_t* req) { done: #if defined(__APPLE__) - pthread_mutex_unlock(&lock); + if (pthread_mutex_unlock(&lock)) + abort(); #endif return r;