Преглед на файлове

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.
Alexander Monakov преди 7 години
родител
ревизия
e53296f889
променени са 1 файла, в които са добавени 1 реда и са изтрити 7 реда
  1. 1 7
      src/misc/wordexp.c

+ 1 - 7
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)