diff options
author | 2013-04-29 00:28:23 +0000 | |
---|---|---|
committer | 2013-04-29 00:28:23 +0000 | |
commit | b779915b23e73132d60ea62cd95d1238b9bcde88 (patch) | |
tree | 416b7bd5c3c8e5e0d5bff4a206f8aceb8cb55ed5 /lib/libc | |
parent | use O_CLOEXEC with open() instead of open/fcntl; from David Hill (diff) | |
download | wireguard-openbsd-b779915b23e73132d60ea62cd95d1238b9bcde88.tar.xz wireguard-openbsd-b779915b23e73132d60ea62cd95d1238b9bcde88.zip |
use FD_CLOEXEC instead of 1; from David Hill
ok otto
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/db/btree/bt_open.c | 4 | ||||
-rw-r--r-- | lib/libc/db/hash/hash.c | 4 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_page.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/syslog_r.c | 4 | ||||
-rw-r--r-- | lib/libc/yp/yp_bind.c | 4 |
5 files changed, 10 insertions, 10 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) { |