diff options
author | Alexander Monakov <amonakov@ispras.ru> | 2018-02-05 17:38:37 +0300 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-02-05 11:40:03 -0500 |
commit | e53296f88952dcc6a9343dea53a4aa911f9a9c87 (patch) | |
tree | 539f842ea335202f5e1743fb7c215debb44971e6 /src | |
parent | cd0ae687deadbb05ed373d675e59a36f8915c86d (diff) | |
download | musl-e53296f88952dcc6a9343dea53a4aa911f9a9c87.tar.gz musl-e53296f88952dcc6a9343dea53a4aa911f9a9c87.tar.bz2 musl-e53296f88952dcc6a9343dea53a4aa911f9a9c87.tar.xz musl-e53296f88952dcc6a9343dea53a4aa911f9a9c87.zip |
re-fix child reaping in wordexp
Do not retry waitpid if the child was terminated by a signal. Do not
examine status: since we are not passing any flags, we will not receive
stop or continue notifications.
Diffstat (limited to 'src')
-rw-r--r-- | src/misc/wordexp.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c index db39b5b8..d123cf75 100644 --- a/src/misc/wordexp.c +++ b/src/misc/wordexp.c @@ -14,13 +14,7 @@ static void reap(pid_t pid) { int status; - for (;;) { - if (waitpid(pid, &status, 0) < 0) { - if (errno != EINTR) return; - } else { - if (WIFEXITED(status)) return; - } - } + while (waitpid(pid, &status, 0) < 0 && errno == EINTR); } static char *getword(FILE *f) |