summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/thread/pthread_atfork.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/thread/pthread_atfork.c b/src/thread/pthread_atfork.c
index 76497401..6d348ac8 100644
--- a/src/thread/pthread_atfork.c
+++ b/src/thread/pthread_atfork.c
@@ -1,4 +1,5 @@
#include <pthread.h>
+#include <errno.h>
#include "libc.h"
#include "lock.h"
@@ -34,7 +35,7 @@ void __fork_handler(int who)
int pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void))
{
struct atfork_funcs *new = malloc(sizeof *new);
- if (!new) return -1;
+ if (!new) return ENOMEM;
LOCK(lock);
new->next = funcs;