From e4a0cfa85d1cf54db71188b0b7c55d9c9f84e1de Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 16 Aug 1997 19:38:35 +0000 Subject: [PATCH] Rewrite to use jump table correctly. --- login/getutid_r.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/login/getutid_r.c b/login/getutid_r.c index 52b83cd8627..d70e94cc171 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 and Paul Janzen , 1996. @@ -20,8 +20,6 @@ #include #include -#include -#include #include #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); -- 2.47.2