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

Modified Files:
        src/lib/libpthread [netbsd-6-0]: 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.1 -r1.125.4.1.4.1 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.1 src/lib/libpthread/pthread.c:1.125.4.1.4.1
--- src/lib/libpthread/pthread.c:1.125.4.1	Mon May  7 03:12:33 2012
+++ src/lib/libpthread/pthread.c	Thu Sep 26 02:02:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.125.4.1 2012/05/07 03:12:33 riz Exp $	*/
+/*	$NetBSD: pthread.c,v 1.125.4.1.4.1 2013/09/26 02:02:07 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.1 2012/05/07 03:12:33 riz Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.125.4.1.4.1 2013/09/26 02:02:07 riz Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -433,6 +433,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