summaryrefslogtreecommitdiff
path: root/src/threads/mtx_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/threads/mtx_init.c')
-rw-r--r--src/threads/mtx_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/threads/mtx_init.c b/src/threads/mtx_init.c
index f3db0ed8..5615736b 100644
--- a/src/threads/mtx_init.c
+++ b/src/threads/mtx_init.c
@@ -1,5 +1,6 @@
#include <threads.h>
#include <pthread.h>
+#include <errno.h>
int mtx_init(mtx_t *mtx, int type)
{
@@ -10,5 +11,5 @@ int mtx_init(mtx_t *mtx, int type)
} else {
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT);
}
- return pthread_mutex_init(mtx, &attr);
+ return pthread_mutex_init(mtx, &attr) == 0 ? thrd_success : thrd_error;
}