summaryrefslogtreecommitdiff
path: root/libc/misc/utmp/utent.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-15 05:58:57 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-15 05:58:57 +0000
commit28d1fcf6a27fd4fad82cf33aaf0ca89808f5c0d0 (patch)
tree4550173623d137e2feaadf93616261493b68383d /libc/misc/utmp/utent.c
parent49dd969022521acd9ef3d0793db0ee1cd1ebcb04 (diff)
make sure we reset static_fd after it's closed in utmpname()
Diffstat (limited to 'libc/misc/utmp/utent.c')
-rw-r--r--libc/misc/utmp/utent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index cb5700fc7..597307738 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -100,9 +100,8 @@ static struct utmp *__getutent(int utmp_fd)
void endutent(void)
{
LOCK;
- if (static_fd != -1) {
+ if (static_fd != -1)
close(static_fd);
- }
static_fd = -1;
UNLOCK;
}
@@ -192,6 +191,7 @@ int utmpname (const char *new_ut_name)
if (static_fd != -1)
close(static_fd);
+ static_fd = -1;
UNLOCK;
return 0;
}