projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd0ae68
)
re-fix child reaping in wordexp
author
Alexander Monakov
<amonakov@ispras.ru>
Mon, 5 Feb 2018 14:38:37 +0000
(17:38 +0300)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 5 Feb 2018 16:40:03 +0000
(11:40 -0500)
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.
src/misc/wordexp.c
patch
|
blob
|
history
diff --git
a/src/misc/wordexp.c
b/src/misc/wordexp.c
index db39b5b8a3e3dee78bf6a54c1af3a1e23013c72b..d123cf757daad53740a4855800eabb440e731ad4 100644
(file)
--- 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)