mirror of
https://github.com/sheumann/hush.git
synced 2024-08-26 12:29:04 +00:00
libbb: spawn should remove child which failed to exec
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3237f5c307
commit
c5d0f15dbd
@ -52,6 +52,7 @@ pid_t FAST_FUNC spawn(char **argv)
|
|||||||
* Interested party can wait on pid and learn exit code.
|
* Interested party can wait on pid and learn exit code.
|
||||||
* If 111 - then it (most probably) failed to exec */
|
* If 111 - then it (most probably) failed to exec */
|
||||||
if (failed) {
|
if (failed) {
|
||||||
|
safe_waitpid(pid, NULL, 0); /* prevent zombie */
|
||||||
errno = failed;
|
errno = failed;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user