mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 13:32:45 +00:00
libc: Use O_CLOEXEC when writing gmon files (cc -pg).
This commit is contained in:
parent
3bd12ca8f1
commit
88d961f32e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254301
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user