Skip to content

Commit c4bb7ab

Browse files
committed
Fix macOS posix_spawn_file_actions_addchdir availability handling
1 parent 0149360 commit c4bb7ab

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

ext/standard/proc_open.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,17 @@
4747
#define USE_POSIX_SPAWN
4848

4949
/* The non-_np variant is in macOS 26 (and _np deprecated) */
50-
#if defined(__APPLE__) && defined(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR) && \
51-
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 260000
52-
#define USE_ADDCHDIR posix_spawn_file_actions_addchdir
50+
# if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 260000
51+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
52+
# else
53+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
54+
# endif
55+
#elif defined(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
56+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
5357
#else
54-
#define USE_ADDCHDIR posix_spawn_file_actions_addchdir_np
58+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
5559
#endif
5660

57-
static inline int php_spawn_addchdir(
58-
posix_spawn_file_actions_t *factions,
59-
const char *cwd
60-
) {
61-
return USE_ADDCHDIR(factions, cwd);
62-
}
63-
64-
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR(f, d) \
65-
php_spawn_addchdir((f), (d))
66-
67-
#endif
6861

6962
/* This symbol is defined in ext/standard/config.m4.
7063
* Essentially, it is set if you HAVE_FORK || PHP_WIN32

0 commit comments

Comments
 (0)