Skip to content

Commit 6daf6bd

Browse files
committed
Call _wputenv_s() also in ZTS builds
This has not been done because `_wputenv_s()` is not thread-safe. However, there is now an environment mutex in place, so that should no longer be an issue.
1 parent 3830855 commit 6daf6bd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ext/standard/basic_functions.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -918,14 +918,11 @@ PHP_FUNCTION(putenv)
918918
error_code = SetEnvironmentVariableW(keyw, valw);
919919

920920
if (error_code != 0
921-
# ifndef ZTS
922-
/* We need both SetEnvironmentVariable and _putenv here as some
921+
/* We need both SetEnvironmentVariable and _putenv here as some
923922
dependency lib could use either way to read the environment.
924923
Obviously the CRT version will be useful more often. But
925-
generally, doing both brings us on the safe track at least
926-
in NTS build. */
927-
&& _wputenv_s(keyw, valw ? valw : L"") == 0
928-
# endif
924+
generally, doing both brings us on the safe track. */
925+
&& _wputenv_s(keyw, valw ? valw : L"") == 0
929926
) { /* success */
930927
# endif
931928
#endif

0 commit comments

Comments
 (0)