about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-15 02:20:21 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-15 02:20:21 -0500
commit59666802fba592a59f2f4ea4dcb053287fd55826 (patch)
treed0e19e99d68afd81d2bf5669585f137c7436fca7
parent1355fdca7cb923c93f9011d8e9dcf49e1a67e537 (diff)
downloadmusl-59666802fba592a59f2f4ea4dcb053287fd55826.tar.gz
musl-59666802fba592a59f2f4ea4dcb053287fd55826.tar.xz
musl-59666802fba592a59f2f4ea4dcb053287fd55826.zip
make pthread_create return EAGAIN on resource failure, as required by POSIX
-rw-r--r--src/thread/pthread_create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 72d7acbc..d01be551 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -212,7 +212,7 @@ int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(vo
 	if (ret < 0) {
 		a_dec(&libc.threads_minus_1);
 		munmap(map, size);
-		return -ret;
+		return EAGAIN;
 	}
 	*res = new;
 	return 0;