aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/db/hash/hash_page.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2013-08-13 19:20:50 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2013-08-13 19:20:50 +0000
commit89521d41087e6b9873ae88be00b63f50c88c8be5 (patch)
treecca8eb84544ed7fe9bcf47c517ae4a746a89f857 /lib/libc/db/hash/hash_page.c
parent595ab5638b1c5db0973608d8c8eda712ed0802ca (diff)
downloadsrc-89521d41087e6b9873ae88be00b63f50c88c8be5.tar.gz
src-89521d41087e6b9873ae88be00b63f50c88c8be5.zip
db: Use O_CLOEXEC instead of separate fcntl() call.
Notes
Notes: svn path=/head/; revision=254289
Diffstat (limited to 'lib/libc/db/hash/hash_page.c')
-rw-r--r--lib/libc/db/hash/hash_page.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c
index fa01775fe8b3..d319d988c165 100644
--- a/lib/libc/db/hash/hash_page.c
+++ b/lib/libc/db/hash/hash_page.c
@@ -862,10 +862,8 @@ open_temp(HTAB *hashp)
/* Block signals; make sure file goes away at process exit. */
(void)sigfillset(&set);
(void)_sigprocmask(SIG_BLOCK, &set, &oset);
- if ((hashp->fp = mkstemp(path)) != -1) {
+ if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1)
(void)unlink(path);
- (void)_fcntl(hashp->fp, F_SETFD, 1);
- }
(void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
return (hashp->fp != -1 ? 0 : -1);
}