summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-04-30 14:30:53 +0000
committernicm <nicm@openbsd.org>2015-04-30 14:30:53 +0000
commit843509fc09e8800608147a26083fbe5e3411a3c6 (patch)
tree0174fca53c000252af0da2b4d3083fe84687a40a
parentSet the correct media type for 1000baseLX SFPs. (diff)
downloadwireguard-openbsd-843509fc09e8800608147a26083fbe5e3411a3c6.tar.xz
wireguard-openbsd-843509fc09e8800608147a26083fbe5e3411a3c6.zip
Add a comment about waitpid, suggested by espie@.
-rw-r--r--usr.bin/file/sandbox.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/file/sandbox.c b/usr.bin/file/sandbox.c
index 2295a53efee..a4d42cf077f 100644
--- a/usr.bin/file/sandbox.c
+++ b/usr.bin/file/sandbox.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sandbox.c,v 1.3 2015/04/30 14:16:49 nicm Exp $ */
+/* $OpenBSD: sandbox.c,v 1.4 2015/04/30 14:30:53 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -116,6 +116,11 @@ sandbox_fork(const char *user)
return (sandbox_child(user));
}
+ /*
+ * Wait for the child to stop itself with SIGSTOP before assigning the
+ * policy, before that it might still be calling syscalls the policy
+ * would block.
+ */
do {
pid = waitpid(pid, &status, WUNTRACED);
} while (pid == -1 && errno == EINTR);