From af687625218080f82b0fecdf0819b0233f881cd6 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 5 Mar 2016 13:12:13 +0000 Subject: safer pattern: if you're interested in one child, get THAT one, don't steal children from other parts of the program. In that case, there's no reason to try to catch other process. 1/ they don't exist 2/ if they did, stealing their status would be bad. okay deraadt@ --- usr.bin/make/cmd_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/make/cmd_exec.c b/usr.bin/make/cmd_exec.c index fad09169c84..5bcf89b80d0 100644 --- a/usr.bin/make/cmd_exec.c +++ b/usr.bin/make/cmd_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd_exec.c,v 1.8 2010/07/19 19:46:43 espie Exp $ */ +/* $OpenBSD: cmd_exec.c,v 1.9 2016/03/05 13:12:12 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. * @@ -107,7 +107,7 @@ Cmd_Exec(const char *cmd, char **err) (void)close(fds[0]); /* Wait for the child to exit. */ - while ((pid = wait(&status)) != cpid && pid >= 0) + while (waitpid(cpid, &status, 0) == -1 && errno == EINTR) continue; if (cc == -1) -- cgit v1.2.3