about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/misc/wordexp.c8
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)