From 5142029bd334cfaa375b68d1826636cba6f0af70 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Wed, 17 Feb 2016 15:20:22 +1100 Subject: [PATCH] thr_lock: Only set stack size when PTHREAD_STACK_MIN is < 64k On powerpc64le with 64k pages, attempting to set stack size to 64k fails, so the thr_lock test fails immediately. Instead, only set the stack when 64k is greater than the minimum stack. The test program now succeeds. Signed-off-by: Daniel Axtens --- mysys/thr_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 1b44405..8a12ed4 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -1629,7 +1629,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) exit(1); } #ifndef pthread_attr_setstacksize /* void return value */ - if ((error=pthread_attr_setstacksize(&thr_attr,65536L))) + if (PTHREAD_STACK_MIN < 65536L && (error=pthread_attr_setstacksize(&thr_attr,65536L))) { fprintf(stderr,"Got error: %d from pthread_attr_setstacksize (errno: %d)", error,errno);