Disable posix_spawn on OpenBSD

OpenBSD has a posix_spawn implementation which fails to return ENOEXEC
on a shebangless script, causing us to fail the shebangless tests.
Disable posix_spawn on OpenBSD.
This commit is contained in:
ridiculousfish 2021-09-18 14:00:17 -07:00
parent 3ed8a57bc5
commit 971073d429

View file

@ -271,6 +271,11 @@ const char *gnu_get_libc_version();
// Disallow posix_spawn entirely on glibc <= 2.24.
// See #8021.
static bool allow_use_posix_spawn() {
// OpenBSD's posix_spawn returns status 127, instead of erroring with ENOEXEC, when faced with a
// shebangless script. Disable posix_spawn on OpenBSD.
#if defined(__OpenBSD__)
return false;
#endif
bool result = true;
// uClibc defines __GLIBC__.
#if defined(__GLIBC__) && !defined(__UCLIBC__)