aboutsummaryrefslogtreecommitdiff
path: root/login/utmp-private.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-08-05 15:54:10 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-08-05 15:55:05 +0200
commit1a7fe2ebe52b3c8bf465d1756e69452d05c1c103 (patch)
tree1d32b2e5a5c55d660354cefb1b02918b62127300 /login/utmp-private.h
parenta6c1ce778e5c05a2e6925883b410157ef47654fd (diff)
downloadglibc-1a7fe2ebe52b3c8bf465d1756e69452d05c1c103.tar
glibc-1a7fe2ebe52b3c8bf465d1756e69452d05c1c103.tar.gz
glibc-1a7fe2ebe52b3c8bf465d1756e69452d05c1c103.tar.bz2
glibc-1a7fe2ebe52b3c8bf465d1756e69452d05c1c103.zip
login: Remove utmp backend jump tables [BZ #23518]
There is just one file-based implementation, so this dispatch mechanism is unnecessary. Instead of the vtable pointer __libc_utmp_jump_table, use a non-negative file_fd as the indicator that the backend is initialized.
Diffstat (limited to 'login/utmp-private.h')
-rw-r--r--login/utmp-private.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/login/utmp-private.h b/login/utmp-private.h
index a82a923657..d60461d644 100644
--- a/login/utmp-private.h
+++ b/login/utmp-private.h
@@ -24,24 +24,17 @@
#include <utmp.h>
#include <libc-lock.h>
-/* The structure describing the functions in a backend. */
-struct utfuncs
-{
- int (*setutent) (void);
- int (*getutent_r) (struct utmp *, struct utmp **);
- int (*getutid_r) (const struct utmp *, struct utmp *, struct utmp **);
- int (*getutline_r) (const struct utmp *, struct utmp *, struct utmp **);
- struct utmp *(*pututline) (const struct utmp *);
- void (*endutent) (void);
- int (*updwtmp) (const char *, const struct utmp *);
-};
-
-/* The tables from the services. */
-extern const struct utfuncs __libc_utmp_file_functions attribute_hidden;
-extern const struct utfuncs __libc_utmp_unknown_functions attribute_hidden;
-
-/* Currently selected backend. */
-extern const struct utfuncs *__libc_utmp_jump_table attribute_hidden;
+/* These functions check for initialization, but not perform any
+ locking. */
+int __libc_setutent (void) attribute_hidden;
+int __libc_getutent_r (struct utmp *, struct utmp **) attribute_hidden;
+int __libc_getutid_r (const struct utmp *, struct utmp *, struct utmp **)
+ attribute_hidden;
+int __libc_getutline_r (const struct utmp *, struct utmp *, struct utmp **)
+ attribute_hidden;
+struct utmp *__libc_pututline (const struct utmp *) attribute_hidden;
+void __libc_endutent (void) attribute_hidden;
+int __libc_updwtmp (const char *, const struct utmp *) attribute_hidden;
/* Current file name. */
extern const char *__libc_utmp_file_name attribute_hidden;