Let's try calling close_range CLOSE_RANGE_CLOEXEC starting on 4 instead of 0

This commit is contained in:
Jarred Sumner
2024-03-27 19:16:23 -07:00
parent 081c7fff00
commit 79ced2767a

View File

@@ -409,7 +409,7 @@ extern "C" void bun_initialize_process()
// This is less of an issue for macOS due to posix_spawn
// This is best effort, not all linux kernels support close_range or CLOSE_RANGE_CLOEXEC
// To avoid breaking --watch, we skip stdin, stdout, stderr and IPC.
bun_close_range(0, ~0U, CLOSE_RANGE_CLOEXEC);
bun_close_range(4, ~0U, CLOSE_RANGE_CLOEXEC);
#endif
#if OS(LINUX) || OS(DARWIN)