Module Name: src
Committed By: bouyer
Date: Sun Oct 20 13:58:32 UTC 2013
Modified Files:
src/lib/libpthread [netbsd-5]: pthread.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1881):
lib/libpthread/pthread.c: revision 1.137 via patch
return errno if pthread_create hits the system limit, not just -1
(this is not entirely correct because it can return ENOMEM which is
not mentioned in the spec, but there are other places in pthread_create
whete ENOMEM is returned -- it at all, this should be fixed everywhere)
To generate a diff of this commit:
cvs rdiff -u -r1.106.2.4 -r1.106.2.5 src/lib/libpthread/pthread.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.106.2.4 src/lib/libpthread/pthread.c:1.106.2.5
--- src/lib/libpthread/pthread.c:1.106.2.4 Sat May 19 16:34:15 2012
+++ src/lib/libpthread/pthread.c Sun Oct 20 13:58:32 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.106.2.4 2012/05/19 16:34:15 riz Exp $ */
+/* $NetBSD: pthread.c,v 1.106.2.5 2013/10/20 13:58:32 bouyer Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.106.2.4 2012/05/19 16:34:15 riz Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.106.2.5 2013/10/20 13:58:32 bouyer Exp $");
#define __EXPOSE_STACK 1
@@ -414,6 +414,7 @@ pthread_create(pthread_t *thread, const
flag |= LWP_SUSPENDED;
ret = _lwp_create(&newthread->pt_uc, flag, &newthread->pt_lid);
if (ret != 0) {
+ ret = errno;
free(name);
newthread->pt_state = PT_STATE_DEAD;
pthread_mutex_lock(&pthread__deadqueue_lock);