Skip to content

Commit bb59003

Browse files
committed
zend call stack fix freebsd code path.
The typo in HAVE_PTHREAD_ATTR_GET`_`STACK (might be due to pthread_attr_get_np being different from Linux's pthread_getattr_np) led to this code path never get called on FreeBSD. Anyway, like Linux the first condition alone is enough, pthread_attr_getstack being present even in the 9.x release's serie.
1 parent d58e3c0 commit bb59003

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Zend/zend_call_stack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static bool zend_call_stack_is_main_thread(void)
251251
return is_main == -1 || is_main == 1;
252252
}
253253

254-
# if defined(HAVE_PTHREAD_ATTR_GET_NP) && defined(HAVE_PTHREAD_ATTR_GET_STACK)
254+
# ifdef HAVE_PTHREAD_ATTR_GET_NP
255255
static bool zend_call_stack_get_freebsd_pthread(zend_call_stack *stack)
256256
{
257257
pthread_attr_t attr;
@@ -285,12 +285,12 @@ static bool zend_call_stack_get_freebsd_pthread(zend_call_stack *stack)
285285
pthread_attr_destroy(&attr);
286286
return false;
287287
}
288-
# else /* defined(HAVE_PTHREAD_ATTR_GET_NP) && defined(HAVE_PTHREAD_ATTR_GET_STACK) */
288+
# else /* HAVE_PTHREAD_ATTR_GET_NP */
289289
static bool zend_call_stack_get_freebsd_pthread(zend_call_stack *stack)
290290
{
291291
return false;
292292
}
293-
# endif /* defined(HAVE_PTHREAD_ATTR_GET_NP) && defined(HAVE_PTHREAD_ATTR_GET_STACK) */
293+
# endif /* HAVE_PTHREAD_ATTR_GET_NP) */
294294

295295
static bool zend_call_stack_get_freebsd_sysctl(zend_call_stack *stack)
296296
{

0 commit comments

Comments
 (0)