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.
This commit is contained in:
Augustin Cavalier
2022-03-09 16:20:42 -05:00
parent 2f26390421
commit 45f4882a72
+2 -1
View File
@@ -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,