summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authorokan <okan@openbsd.org>2013-04-29 00:28:23 +0000
committerokan <okan@openbsd.org>2013-04-29 00:28:23 +0000
commitb779915b23e73132d60ea62cd95d1238b9bcde88 (patch)
tree416b7bd5c3c8e5e0d5bff4a206f8aceb8cb55ed5 /lib/libutil
parentuse O_CLOEXEC with open() instead of open/fcntl; from David Hill (diff)
downloadwireguard-openbsd-b779915b23e73132d60ea62cd95d1238b9bcde88.tar.xz
wireguard-openbsd-b779915b23e73132d60ea62cd95d1238b9bcde88.zip
use FD_CLOEXEC instead of 1; from David Hill
ok otto
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/passwd.c4
1 files changed, 2 insertions, 2 deletions
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;
}