Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ dnl

PHP_CHECK_FUNC(res_search, resolv, socket)

AC_CHECK_FUNCS([posix_spawn_file_actions_addchdir_np elf_aux_info])
AC_CHECK_FUNCS([posix_spawn_file_actions_addchdir posix_spawn_file_actions_addchdir_np elf_aux_info])

dnl
dnl Obsolete check for strptime() declaration. The strptime, where available,
Expand Down
7 changes: 7 additions & 0 deletions ext/standard/proc_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,10 +1394,17 @@ PHP_FUNCTION(proc_open)
}

if (cwd) {
#ifdef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
r = posix_spawn_file_actions_addchdir(&factions, cwd);
if (r != 0) {
php_error_docref(NULL, E_WARNING, "posix_spawn_file_actions_addchdir() failed: %s", strerror(r));
}
#else
r = posix_spawn_file_actions_addchdir_np(&factions, cwd);
if (r != 0) {
php_error_docref(NULL, E_WARNING, "posix_spawn_file_actions_addchdir_np() failed: %s", strerror(r));
}
#endif
}

if (argv) {
Expand Down