summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-08-16 19:38:35 +0000
committerUlrich Drepper <drepper@redhat.com>1997-08-16 19:38:35 +0000
commite4a0cfa85d1cf54db71188b0b7c55d9c9f84e1de (patch)
treedf1d22e8194276bf86dfd4876cf6dead8ee6c52e
parent3890740829f1b20b65a04b9f78c95ded51ed911c (diff)
Rewrite to use jump table correctly.
-rw-r--r--login/getutid_r.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/login/getutid_r.c b/login/getutid_r.c
index 52b83cd862..d70e94cc17 100644
--- a/login/getutid_r.c
+++ b/login/getutid_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
@@ -20,8 +20,6 @@
#include <errno.h>
#include <libc-lock.h>
-#include <string.h>
-#include <unistd.h>
#include <utmp.h>
#include "utmp-private.h"
@@ -38,7 +36,7 @@ int
__getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result)
{
#if (_HAVE_UT_ID - 0) && (_HAVE_UT_TYPE - 0)
- int retval = -1;
+ int retval;
/* Test whether ID has any of the legal types. */
if (id->ut_type != RUN_LVL && id->ut_type != BOOT_TIME
@@ -54,11 +52,7 @@ __getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result)
__libc_lock_lock (__libc_utmp_lock);
- /* Not yet initialized. */
- if ((*__libc_utmp_jump_table->setutent) (0))
- retval = (*__libc_utmp_jump_table->getutid_r) (id, buffer, result);
- else
- *result = NULL;
+ retval = (*__libc_utmp_jump_table->getutid_r) (id, buffer, result);
__libc_lock_unlock (__libc_utmp_lock);