diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2016-03-05 13:12:13 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2016-03-05 13:12:13 +0000 |
commit | af687625218080f82b0fecdf0819b0233f881cd6 (patch) | |
tree | 5e9996f9f08c3a6431683487be854a5a1bfbba56 | |
parent | c6b7470e71fa92195d147f95d5431c37290cfb62 (diff) |
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.c | 4 |
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) |