Skip to content

Commit 24b312f

Browse files
committed
MFH: missing part of the fix for #39795
1 parent 53f89fa commit 24b312f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

acinclude.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,6 +2600,7 @@ AC_DEFUN([PHP_CRYPT_R_STYLE],
26002600
AC_CACHE_CHECK([which data struct is used by crypt_r], php_cv_crypt_r_style,[
26012601
php_cv_crypt_r_style=none
26022602
AC_TRY_COMPILE([
2603+
#define _REENTRANT 1
26032604
#include <crypt.h>
26042605
],[
26052606
CRYPTD buffer;
@@ -2609,6 +2610,7 @@ php_cv_crypt_r_style=cryptd)
26092610
26102611
if test "$php_cv_crypt_r_style" = "none"; then
26112612
AC_TRY_COMPILE([
2613+
#define _REENTRANT 1
26122614
#include <crypt.h>
26132615
],[
26142616
struct crypt_data buffer;
@@ -2619,6 +2621,7 @@ php_cv_crypt_r_style=struct_crypt_data)
26192621
26202622
if test "$php_cv_crypt_r_style" = "none"; then
26212623
AC_TRY_COMPILE([
2624+
#define _REENTRANT 1
26222625
#define _GNU_SOURCE
26232626
#include <crypt.h>
26242627
],[

ext/standard/crypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ PHP_FUNCTION(crypt)
148148
salt[2] = '\0';
149149
#endif
150150
}
151-
#ifdef HAVE_CRYPT_R
151+
#if defined(HAVE_CRYPT_R) && defined(_REENTRANT)
152152
{
153153
#if defined(CRYPT_R_STRUCT_CRYPT_DATA)
154154
struct crypt_data buffer;

0 commit comments

Comments
 (0)