aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJaakko Heinonen <jh@FreeBSD.org>2010-02-08 15:50:51 +0000
committerJaakko Heinonen <jh@FreeBSD.org>2010-02-08 15:50:51 +0000
commit3ede63a7e391cf89805dd0cbafec82532720d893 (patch)
tree3cc3fcbf828c21d4d80f9b3deab3302e1d014f33 /usr.bin
parent33e6da3c3a90d014f37606acd6b34f47f22a4a22 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/truss/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c
index d0dd073e632f..586fcd642990 100644
--- a/usr.bin/truss/main.c
+++ b/usr.bin/truss/main.c
@@ -239,6 +239,12 @@ main(int ac, char **av)
if ((trussinfo->outfile = fopen(fname, "w")) == NULL)
errx(1, "cannot open %s", fname);
}
+ /*
+ * Set FD_CLOEXEC, so that the output file is not shared with
+ * the traced process.
+ */
+ if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1)
+ warn("fcntl()");
/*
* If truss starts the process itself, it will ignore some signals --