diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-02-15 05:58:57 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-02-15 05:58:57 +0000 |
commit | 28d1fcf6a27fd4fad82cf33aaf0ca89808f5c0d0 (patch) | |
tree | 4550173623d137e2feaadf93616261493b68383d /libc/misc/utmp | |
parent | 49dd969022521acd9ef3d0793db0ee1cd1ebcb04 (diff) |
make sure we reset static_fd after it's closed in utmpname()
Diffstat (limited to 'libc/misc/utmp')
-rw-r--r-- | libc/misc/utmp/utent.c | 4 |
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; } |