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:
@@ -593,7 +593,8 @@ do_posix_spawn(pid_t *_pid, const char *path,
|
|||||||
const posix_spawnattr_t *attrp, char *const argv[], char *const envp[],
|
const posix_spawnattr_t *attrp, char *const argv[], char *const envp[],
|
||||||
bool envpath)
|
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);
|
return spawn_using_load_image(_pid, path, argv, envp, envpath);
|
||||||
} else {
|
} else {
|
||||||
return spawn_using_fork(_pid, path, actions, attrp, argv, envp,
|
return spawn_using_fork(_pid, path, actions, attrp, argv, envp,
|
||||||
|
|||||||
Reference in New Issue
Block a user