]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap_r/thr_posix.c
Cleanup unused vars
[openldap] / libraries / libldap_r / thr_posix.c
index 2a770f33154c26b374e9d7b32f3b8d78a21ecae6..8c3d98552555200c05e472a7b8da092410af29d3 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2013 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -33,6 +33,8 @@
 #include "ldap_thr_debug.h"     /* May rename the symbols defined below */
 #include <signal.h>                     /* For pthread_kill() */
 
+extern int ldap_int_stackguard;
+
 #if HAVE_PTHREADS < 6
 #  define LDAP_INT_THREAD_ATTR_DEFAULT         pthread_attr_default
 #  define LDAP_INT_THREAD_CONDATTR_DEFAULT     pthread_condattr_default
@@ -148,6 +150,8 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
 #ifdef LDAP_PVT_THREAD_SET_STACK_SIZE
        /* this should be tunable */
        pthread_attr_setstacksize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
+       if ( ldap_int_stackguard )
+               pthread_attr_setguardsize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
 #endif
 
 #if HAVE_PTHREADS > 5