diff options
| author | Jilles Tjoelker <jilles@FreeBSD.org> | 2013-08-11 15:38:48 +0000 |
|---|---|---|
| committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2013-08-11 15:38:48 +0000 |
| commit | 46d71747f695d27c40a8c79b60ed81a92ade1c83 (patch) | |
| tree | f9042afa3d4bc4298b610da3609e7e1c38829664 /lib/libc/db | |
| parent | f24deb02bda2aed70aa13687611feaa609f53f26 (diff) | |
Notes
Diffstat (limited to 'lib/libc/db')
| -rw-r--r-- | lib/libc/db/hash/hash.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 638814ceb5d2..af80929112b0 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -121,9 +121,8 @@ __hash_open(const char *file, int flags, int mode, hashp->flags = flags; if (file) { - if ((hashp->fp = _open(file, flags, mode)) == -1) + if ((hashp->fp = _open(file, flags | O_CLOEXEC, mode)) == -1) RETURN_ERROR(errno, error0); - (void)_fcntl(hashp->fp, F_SETFD, 1); new_table = _fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0 && (flags & O_ACCMODE) != O_RDONLY; } else |
