From 49dd969022521acd9ef3d0793db0ee1cd1ebcb04 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 15 Feb 2006 05:53:28 +0000 Subject: fix fcntl() call so that it actually forces file to be closed on exec() --- libc/misc/utmp/utent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit v1.2.3