From: Alexander Monakov Date: Mon, 5 Feb 2018 14:38:37 +0000 (+0300) Subject: re-fix child reaping in wordexp X-Git-Tag: v1.1.19~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e53296f88952dcc6a9343dea53a4aa911f9a9c87;p=oweals%2Fmusl.git 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. --- 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)