diff options
author | jilles <jilles@FreeBSD.org> | 2013-08-13 21:45:48 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-08-13 21:45:48 +0000 |
commit | e3e0bd874e439a7ced10380adec12fa4ca4ec23e (patch) | |
tree | e103bda3895f3d569c982417f1e9fb243d4e3696 | |
parent | c55a3ec3ad5884ca8d071250121cadfedbfe9687 (diff) | |
download | FreeBSD-src-e3e0bd874e439a7ced10380adec12fa4ca4ec23e.zip FreeBSD-src-e3e0bd874e439a7ced10380adec12fa4ca4ec23e.tar.gz |
libc: Use O_CLOEXEC when writing gmon files (cc -pg).
-rw-r--r-- | lib/libc/gmon/gmon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c index 8f508b0..1f56bc2 100644 --- a/lib/libc/gmon/gmon.c +++ b/lib/libc/gmon/gmon.c @@ -163,13 +163,13 @@ _mcleanup(void) else snprintf(outname, sizeof(outname), "%s.gmon", _getprogname()); - fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY, 0666); + fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0666); if (fd < 0) { _warn("_mcleanup: %s", outname); return; } #ifdef DEBUG - log = _open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY, 0664); + log = _open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0664); if (log < 0) { _warn("_mcleanup: gmon.log"); return; |