libc: make posix_spawn(3) clean up child on failure
Change-Id: I39a321f23326485fca789e5792a57532d1036716
This commit is contained in:
parent
b52b83f927
commit
1bb466dd36
@ -265,6 +265,9 @@ posix_spawn(pid_t * __restrict pid, const char * __restrict path,
|
||||
error = errno;
|
||||
close(pfd[0]);
|
||||
|
||||
if (error != 0)
|
||||
(void)waitpid(p, NULL, 0);
|
||||
|
||||
if (pid != NULL)
|
||||
*pid = p;
|
||||
return error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user