summaryrefslogtreecommitdiff
path: root/libc/misc/utmp/utent.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-12-07 16:09:49 (GMT)
committerPeter S. Mazinger <ps.m@gmx.net>2005-12-07 16:09:49 (GMT)
commit53b5f21c9c453ff74c9aabdecd166a5e6ddb202b (patch)
tree7e94f2193471512a521b3675b28a27b829a43707 /libc/misc/utmp/utent.c
parent746d0019f275acc0d3752b54e8ae1930a2f5fa3c (diff)
Hide more
Diffstat (limited to 'libc/misc/utmp/utent.c')
-rw-r--r--libc/misc/utmp/utent.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index e03d452..374b53b 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -37,29 +37,7 @@ static struct utmp static_utmp;
static const char default_file_name[] = _PATH_UTMP;
static const char *static_ut_name = (const char *) default_file_name;
-
-
-static struct utmp *__getutent(int utmp_fd)
-
-{
- if (utmp_fd == -1) {
- setutent();
- }
- if (utmp_fd == -1) {
- return NULL;
- }
-
- LOCK;
- if (__read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp))
- {
- return NULL;
- }
-
- UNLOCK;
- return &static_utmp;
-}
-
-void setutent(void)
+void attribute_hidden __setutent(void)
{
int ret;
@@ -87,6 +65,26 @@ bummer:
UNLOCK;
return;
}
+strong_alias(__setutent,setutent)
+
+static struct utmp *__getutent(int utmp_fd)
+{
+ if (utmp_fd == -1) {
+ __setutent();
+ }
+ if (utmp_fd == -1) {
+ return NULL;
+ }
+
+ LOCK;
+ if (__read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp))
+ {
+ return NULL;
+ }
+
+ UNLOCK;
+ return &static_utmp;
+}
void endutent(void)
{
@@ -148,8 +146,6 @@ struct utmp *getutline(const struct utmp *utmp_entry)
return NULL;
}
-extern struct utmp *__getutid (__const struct utmp *__id) attribute_hidden;
-
struct utmp *pututline (const struct utmp *utmp_entry)
{
LOCK;
@@ -190,4 +186,3 @@ int utmpname (const char *new_ut_name)
UNLOCK;
return 0;
}
-