summaryrefslogtreecommitdiff
path: root/libc/misc/utmp/utent.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-15 05:53:28 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-15 05:53:28 +0000
commit49dd969022521acd9ef3d0793db0ee1cd1ebcb04 (patch)
tree210639a9620b07dae56f2c77d7ec85aacf12b0fb /libc/misc/utmp/utent.c
parent6fee9b33057a1dd37e4a6d0bc924f65327da5ce2 (diff)
fix fcntl() call so that it actually forces file to be closed on exec()
Diffstat (limited to 'libc/misc/utmp/utent.c')
-rw-r--r--libc/misc/utmp/utent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index 945571733..cb5700fc7 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -60,7 +60,7 @@ void setutent(void)
/* Make sure the file will be closed on exec() */
ret = fcntl(static_fd, F_GETFD, 0);
if (ret >= 0) {
- ret = fcntl(static_fd, F_GETFD, 0);
+ ret = fcntl(static_fd, F_SETFD, ret | FD_CLOEXEC);
}
if (ret < 0) {
bummer: