summaryrefslogtreecommitdiff
path: root/pthread/pt-create.c
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2012-09-15 19:14:21 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-09-15 21:43:06 +0200
commitce51f55217a6dc7f1e611d10e0b09c6d39152a8f (patch)
tree517e35b1eb00d77d23361764566e048b12d02213 /pthread/pt-create.c
parent549aba4335946c26f2701c2b43be0e6148d27c09 (diff)
pthread_create: turn ENOMEM to EAGAIN
ENOMEM can be returned if some malloc fail, but it is not a valid POSIX error number for pthread_create; thus turn it to EAGAIN. * pthread/pt-create.c (pthread_create): Turn ENOMEM to EAGAIN.
Diffstat (limited to 'pthread/pt-create.c')
-rw-r--r--pthread/pt-create.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index 4d81a95..25a3607 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -66,6 +66,8 @@ pthread_create (pthread_t *thread, const pthread_attr_t *attr,
err = __pthread_create_internal (&pthread, attr, start_routine, arg);
if (! err)
*thread = pthread->thread;
+ else if (err == ENOMEM)
+ err = EAGAIN;
return err;
}