Module Name:    src
Committed By:   drochner
Date:           Fri Mar  9 12:06:45 UTC 2012

Modified Files:
        src/lib/libpthread: pthread.c

Log Message:
-fix initial stacksize rounding
-minor indentation fix


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 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.128 src/lib/libpthread/pthread.c:1.129
--- src/lib/libpthread/pthread.c:1.128	Thu Mar  8 16:40:45 2012
+++ src/lib/libpthread/pthread.c	Fri Mar  9 12:06:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.128 2012/03/08 16:40:45 joerg Exp $	*/
+/*	$NetBSD: pthread.c,v 1.129 2012/03/09 12:06:44 drochner 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.128 2012/03/08 16:40:45 joerg Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.129 2012/03/09 12:06:44 drochner Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -340,7 +340,7 @@ pthread__newstack(pthread_t newthread, c
 		mapped_stack = true;
 	}
 	newthread->pt_stack.ss_size = pthread__stacksize - pthread__pagesize;
-		newthread->pt_stack.ss_sp = stackbase;
+	newthread->pt_stack.ss_sp = stackbase;
 #ifdef __MACHINE_STACK_GROWS_UP
 	redzone = (char *)stackbase + newthread->pt_stack.ss_size;
 #else
@@ -1260,7 +1260,7 @@ pthread__initmain(pthread_t *newt)
 	if (pthread__stacksize == 0)
 		pthread__stacksize = pthread__main.pt_stack.ss_size;
 	pthread__stacksize += pthread__pagesize - 1;
-	pthread__stacksize &= ~pthread__pagesize;
+	pthread__stacksize &= ~(pthread__pagesize - 1);
 	if (pthread__stacksize < 4 * pthread__pagesize)
 		errx(1, "Stacksize limit is too low, minimum %zd kbyte.",
 		    4 * pthread__pagesize / 1024);

Reply via email to