From 48a92e9d2da28b7bef8474f1effda68c13ed2fd1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 26 Apr 2001 13:44:29 +0000 Subject: Update. 2001-04-26 Ulrich Drepper * nis/nss-nis.h: Move yperr2nss_tab definition into separate file and rename to __yperr2nss_tab. Change YPERR_COUNT into variable __yperr2nss_count. * nis/nss-nis.c: New file. * nis/Makefile (libnss_compat-routines): Add nss-nis. (libnss_nis-routines): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: Some more optimizations. Patch by Jakub Jelinek . --- nis/nss-nis.h | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'nis/nss-nis.h') diff --git a/nis/nss-nis.h b/nis/nss-nis.h index 13ba62ed9f..8d5ff5619a 100644 --- a/nis/nss-nis.h +++ b/nis/nss-nis.h @@ -25,34 +25,15 @@ /* Convert YP error number to NSS error number. */ -static enum nss_status yperr2nss_tab[] = -{ - [YPERR_SUCCESS] = NSS_STATUS_SUCCESS, - [YPERR_BADARGS] = NSS_STATUS_UNAVAIL, - [YPERR_RPC] = NSS_STATUS_UNAVAIL, - [YPERR_DOMAIN] = NSS_STATUS_UNAVAIL, - [YPERR_MAP] = NSS_STATUS_UNAVAIL, - [YPERR_KEY] = NSS_STATUS_NOTFOUND, - [YPERR_YPERR] = NSS_STATUS_UNAVAIL, - [YPERR_RESRC] = NSS_STATUS_TRYAGAIN, - [YPERR_NOMORE] = NSS_STATUS_NOTFOUND, - [YPERR_PMAP] = NSS_STATUS_UNAVAIL, - [YPERR_YPBIND] = NSS_STATUS_UNAVAIL, - [YPERR_YPSERV] = NSS_STATUS_UNAVAIL, - [YPERR_NODOM] = NSS_STATUS_UNAVAIL, - [YPERR_BADDB] = NSS_STATUS_UNAVAIL, - [YPERR_VERS] = NSS_STATUS_UNAVAIL, - [YPERR_ACCESS] = NSS_STATUS_UNAVAIL, - [YPERR_BUSY] = NSS_STATUS_TRYAGAIN -}; -#define YPERR_COUNT (sizeof (yperr2nss_tab) / sizeof (yperr2nss_tab[0])) +extern const enum nss_status __yperr2nss_tab[]; +extern const unsigned int __yperr2nss_count; static inline enum nss_status yperr2nss (int errval) { - if ((unsigned int) errval > YPERR_COUNT) + if ((unsigned int) errval > __yperr2nss_count) return NSS_STATUS_UNAVAIL; - return yperr2nss_tab[errval]; + return __yperr2nss_tab[errval]; } #endif /* nis/nss-nis.h */ -- cgit v1.2.3-65-gdbad