From 28d1fcf6a27fd4fad82cf33aaf0ca89808f5c0d0 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 15 Feb 2006 05:58:57 +0000 Subject: make sure we reset static_fd after it's closed in utmpname() --- libc/misc/utmp/utent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/misc/utmp/utent.c') 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; } -- cgit v1.2.3