提交 e53296f8 编写于 作者: A Alexander Monakov 提交者: Rich Felker

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.
上级 cd0ae687
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册