Date: Tue, 13 Aug 2013 21:45:48 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254301 - head/lib/libc/gmon Message-ID: <201308132145.r7DLjmB7006846@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Tue Aug 13 21:45:48 2013 New Revision: 254301 URL: http://svnweb.freebsd.org/changeset/base/254301 Log: libc: Use O_CLOEXEC when writing gmon files (cc -pg). Modified: head/lib/libc/gmon/gmon.c Modified: head/lib/libc/gmon/gmon.c ============================================================================== --- head/lib/libc/gmon/gmon.c Tue Aug 13 21:34:03 2013 (r254300) +++ head/lib/libc/gmon/gmon.c Tue Aug 13 21:45:48 2013 (r254301) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308132145.r7DLjmB7006846>