summaryrefslogtreecommitdiffstats
path: root/libutil
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2012-12-27 20:24:44 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2012-12-27 20:24:44 +0000
commitac2faf4bbf898c2f46cb06a82893638622806ac7 (patch)
treeef19ded158ff019673eb4866ffe75840caefcb7b /libutil
parentdb8e9b62df85e4ed7de7938e68c221930a9a30c6 (diff)
downloadpw-darwin-ac2faf4bbf898c2f46cb06a82893638622806ac7.tar.gz
pw-darwin-ac2faf4bbf898c2f46cb06a82893638622806ac7.tar.zst
pw-darwin-ac2faf4bbf898c2f46cb06a82893638622806ac7.zip
Add O_CLOEXEC to flopen
Requested by: jilles
Diffstat (limited to 'libutil')
-rw-r--r--libutil/gr_util.c2
-rw-r--r--libutil/pw_util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libutil/gr_util.c b/libutil/gr_util.c
index 2f87bd1..4583257 100644
--- a/libutil/gr_util.c
+++ b/libutil/gr_util.c
@@ -101,7 +101,7 @@ gr_lock(void)
for (;;) {
struct stat st;
- lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK, 0);
+ lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
if (lockfd == -1) {
if (errno == EWOULDBLOCK) {
errx(1, "the group file is busy");
diff --git a/libutil/pw_util.c b/libutil/pw_util.c
index 24c0263..befd1fb 100644
--- a/libutil/pw_util.c
+++ b/libutil/pw_util.c
@@ -179,7 +179,7 @@ pw_lock(void)
for (;;) {
struct stat st;
- lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK, 0);
+ lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
if (lockfd == -1) {
if (errno == EWOULDBLOCK) {
errx(1, "the password db file is busy");