summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2016-03-05 13:12:12 +0000
committerespie <espie@openbsd.org>2016-03-05 13:12:12 +0000
commit5a3322f33a8afa437a406ff1b7abdd70357121d6 (patch)
treef77bee5b4aa245c3fd182b1a98748f76a6f838f6
parentadd proper entries for pkg_add privsep, instead of piggy-backing on _pfetch (diff)
downloadwireguard-openbsd-5a3322f33a8afa437a406ff1b7abdd70357121d6.tar.xz
wireguard-openbsd-5a3322f33a8afa437a406ff1b7abdd70357121d6.zip
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@
-rw-r--r--usr.bin/make/cmd_exec.c4
1 files changed, 2 insertions, 2 deletions
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)