diff options
| author | kamil <kamil@NetBSD.org> | 2020-01-29 15:15:00 +0000 |
|---|---|---|
| committer | kamil <kamil@NetBSD.org> | 2020-01-29 15:15:00 +0000 |
| commit | 11d90fc224669a100cc52e865bfc72cbcd4e78eb (patch) | |
| tree | e74b25b9df57ca5a8365348a9dc0463726a32735 /lib/libpthread/pthread.c | |
| parent | 893fd28abb255a033c6651e1e8bf40f15e42c93b (diff) | |
Do not set stackbase2 twice for !__MACHINE_STACK_GROWS_UP
Diffstat (limited to 'lib/libpthread/pthread.c')
| -rw-r--r-- | lib/libpthread/pthread.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c index 735e202d5c1..d77aa248f3a 100644 --- a/lib/libpthread/pthread.c +++ b/lib/libpthread/pthread.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread.c,v 1.158 2020/01/28 09:23:15 ad Exp $ */ +/* $NetBSD: pthread.c,v 1.159 2020/01/29 15:15:00 kamil Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020 @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread.c,v 1.158 2020/01/28 09:23:15 ad Exp $"); +__RCSID("$NetBSD: pthread.c,v 1.159 2020/01/29 15:15:00 kamil Exp $"); #define __EXPOSE_STACK 1 @@ -362,8 +362,9 @@ pthread__getstack(pthread_t newthread, const pthread_attr_t *attr) newthread->pt_stack.ss_size == stacksize && newthread->pt_guardsize == guardsize) return 0; +#ifdef __MACHINE_STACK_GROWS_UP stackbase2 = newthread->pt_stack.ss_sp; -#ifndef __MACHINE_STACK_GROWS_UP +#else stackbase2 = (char *)stackbase2 - newthread->pt_guardsize; #endif munmap(stackbase2, |
