Module Name:    src
Committed By:   riz
Date:           Thu Sep 26 02:03:09 UTC 2013

Modified Files:
        src/lib/libpthread [netbsd-6]: pthread.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #959):
        lib/libpthread/pthread.c: revision 1.137
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.125.4.3 -r1.125.4.4 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.125.4.3 src/lib/libpthread/pthread.c:1.125.4.4
--- src/lib/libpthread/pthread.c:1.125.4.3	Mon Apr 29 01:50:19 2013
+++ src/lib/libpthread/pthread.c	Thu Sep 26 02:03:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.125.4.3 2013/04/29 01:50:19 riz Exp $	*/
+/*	$NetBSD: pthread.c,v 1.125.4.4 2013/09/26 02:03:09 riz 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.125.4.3 2013/04/29 01:50:19 riz Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.125.4.4 2013/09/26 02:03:09 riz Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -443,6 +443,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;
 		pthread_mutex_lock(&newthread->pt_lock);
 		/* Will unlock and free name. */
 		pthread__reap(newthread);

Reply via email to