From 893b957ab23fe3eb2386c9acedd396606f76b5cb Mon Sep 17 00:00:00 2001 From: Okan Demirmen Date: Mon, 29 Apr 2013 00:28:24 +0000 Subject: use FD_CLOEXEC instead of 1; from David Hill ok otto --- lib/libc/db/btree/bt_open.c | 4 ++-- lib/libc/db/hash/hash.c | 4 ++-- lib/libc/db/hash/hash_page.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libc/db') diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c index d837df88ae2..b49aa0413f8 100644 --- a/lib/libc/db/btree/bt_open.c +++ b/lib/libc/db/btree/bt_open.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_open.c,v 1.14 2007/09/17 07:07:23 moritz Exp $ */ +/* $OpenBSD: bt_open.c,v 1.15 2013/04/29 00:28:23 okan Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -204,7 +204,7 @@ __bt_open(const char *fname, int flags, int mode, const BTREEINFO *openinfo, F_SET(t, B_INMEM); } - if (fcntl(t->bt_fd, F_SETFD, 1) == -1) + if (fcntl(t->bt_fd, F_SETFD, FD_CLOEXEC) == -1) goto err; if (fstat(t->bt_fd, &sb)) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index f97cf4d1db9..4f428e86377 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash.c,v 1.23 2010/07/02 16:46:28 guenther Exp $ */ +/* $OpenBSD: hash.c,v 1.24 2013/04/29 00:28:23 okan Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -117,7 +117,7 @@ __hash_open(const char *file, int flags, int mode, if (file) { if ((hashp->fp = open(file, flags, mode)) == -1) RETURN_ERROR(errno, error0); - (void)fcntl(hashp->fp, F_SETFD, 1); + (void)fcntl(hashp->fp, F_SETFD, FD_CLOEXEC); new_table = fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0 && (flags & O_ACCMODE) != O_RDONLY; } else diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c index 05bc2734506..c8d633ba89d 100644 --- a/lib/libc/db/hash/hash_page.c +++ b/lib/libc/db/hash/hash_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash_page.c,v 1.19 2008/05/11 22:21:25 millert Exp $ */ +/* $OpenBSD: hash_page.c,v 1.20 2013/04/29 00:28:23 okan Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -858,7 +858,7 @@ open_temp(HTAB *hashp) (void)sigprocmask(SIG_BLOCK, &set, &oset); if ((hashp->fp = mkstemp(path)) != -1) { (void)unlink(path); - (void)fcntl(hashp->fp, F_SETFD, 1); + (void)fcntl(hashp->fp, F_SETFD, FD_CLOEXEC); } (void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); return (hashp->fp != -1 ? 0 : -1); -- cgit v1.2.3