From 45f4882a72787c45f04bed0d32a09273313f2322 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 9 Mar 2022 16:20:42 -0500 Subject: [PATCH] libroot: Allow posix_spawn to use load_image in more cases. If a spawnattr and file_actions are specified but empty, that can be treated the same as if they were passed as NULL. --- src/system/libroot/posix/spawn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/spawn.cpp b/src/system/libroot/posix/spawn.cpp index 091720bef0..510f90901c 100644 --- a/src/system/libroot/posix/spawn.cpp +++ b/src/system/libroot/posix/spawn.cpp @@ -593,7 +593,8 @@ do_posix_spawn(pid_t *_pid, const char *path, const posix_spawnattr_t *attrp, char *const argv[], char *const envp[], bool envpath) { - if (actions == NULL && attrp == NULL) { + if ((actions == NULL || (*actions)->count == 0) + && (attrp == NULL || (*attrp)->flags == 0)) { return spawn_using_load_image(_pid, path, argv, envp, envpath); } else { return spawn_using_fork(_pid, path, actions, attrp, argv, envp,