summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/btree/bt_open.c4
-rw-r--r--lib/libc/db/hash/hash.c4
-rw-r--r--lib/libc/db/hash/hash_page.c4
-rw-r--r--lib/libc/gen/syslog_r.c4
-rw-r--r--lib/libc/yp/yp_bind.c4
-rw-r--r--lib/libevent/signal.c4
-rw-r--r--lib/libutil/passwd.c4
7 files changed, 14 insertions, 14 deletions
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);
diff --git a/lib/libc/gen/syslog_r.c b/lib/libc/gen/syslog_r.c
index 2a966a4ba62..e74479f244d 100644
--- a/lib/libc/gen/syslog_r.c
+++ b/lib/libc/gen/syslog_r.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslog_r.c,v 1.3 2011/05/30 18:48:33 martynas Exp $ */
+/* $OpenBSD: syslog_r.c,v 1.4 2013/04/29 00:28:23 okan Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
@@ -279,7 +279,7 @@ connectlog_r(struct syslog_data *data)
if (data->log_file == -1) {
if ((data->log_file = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
return;
- (void)fcntl(data->log_file, F_SETFD, 1);
+ (void)fcntl(data->log_file, F_SETFD, FD_CLOEXEC);
}
if (data->log_file != -1 && !data->connected) {
memset(&SyslogAddr, '\0', sizeof(SyslogAddr));
diff --git a/lib/libc/yp/yp_bind.c b/lib/libc/yp/yp_bind.c
index 80197adb674..42d87a5c407 100644
--- a/lib/libc/yp/yp_bind.c
+++ b/lib/libc/yp/yp_bind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_bind.c,v 1.17 2009/06/05 17:19:00 schwarze Exp $ */
+/* $OpenBSD: yp_bind.c,v 1.18 2013/04/29 00:28:23 okan Exp $ */
/*
* Copyright (c) 1992, 1993, 1996 Theo de Raadt <deraadt@theos.com>
* All rights reserved.
@@ -242,7 +242,7 @@ gotdata:
ysd->dom_vers = -1;
goto again;
}
- if (fcntl(ysd->dom_socket, F_SETFD, 1) == -1)
+ if (fcntl(ysd->dom_socket, F_SETFD, FD_CLOEXEC) == -1)
perror("fcntl: F_SETFD");
if (new) {
diff --git a/lib/libevent/signal.c b/lib/libevent/signal.c
index 81f3ed461e5..5d2531c37af 100644
--- a/lib/libevent/signal.c
+++ b/lib/libevent/signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.c,v 1.15 2010/07/12 18:03:38 nicm Exp $ */
+/* $OpenBSD: signal.c,v 1.16 2013/04/29 00:28:23 okan Exp $ */
/*
* Copyright 2000-2002 Niels Provos <provos@citi.umich.edu>
@@ -85,7 +85,7 @@ evsignal_cb(int fd, short what, void *arg)
#ifdef HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
- if (fcntl(x, F_SETFD, 1) == -1) \
+ if (fcntl(x, F_SETFD, FD_CLOEXEC) == -1) \
event_warn("fcntl(%d, F_SETFD)", x); \
} while (0)
#else
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c
index cb2cd2ba269..11ee752e8a4 100644
--- a/lib/libutil/passwd.c
+++ b/lib/libutil/passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: passwd.c,v 1.49 2006/12/20 23:07:36 ray Exp $ */
+/* $OpenBSD: passwd.c,v 1.50 2013/04/29 00:28:23 okan Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@@ -107,7 +107,7 @@ pw_lock(int retries)
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL, 0600);
}
save_errno = errno;
- if (fd != -1 && fcntl(fd, F_SETFD, 1) == -1) {
+ if (fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
close(fd);
fd = -1;
}