diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-02-25 16:15:09 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-02-25 16:15:09 +0100 |
commit | d423e17031f379d51c5ad6c33e8b57380c8eea35 (patch) | |
tree | 9511953dc53ed9600e5680901749efa1917875d2 /nis/nss_nis/nis-hosts.c | |
parent | 783e641fbae0cd1ab32d278216247a6f793dd722 (diff) | |
download | glibc-d423e17031f379d51c5ad6c33e8b57380c8eea35.tar.gz glibc-d423e17031f379d51c5ad6c33e8b57380c8eea35.tar.xz glibc-d423e17031f379d51c5ad6c33e8b57380c8eea35.zip |
nss_nis: Use NSS_DECLARE_MODULE_FUNCTIONS
This commit removes the minor optimization based on strong aliases because it loses type safety.
Diffstat (limited to 'nis/nss_nis/nis-hosts.c')
-rw-r--r-- | nis/nss_nis/nis-hosts.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c index 2d08076382..eb074783f7 100644 --- a/nis/nss_nis/nis-hosts.c +++ b/nis/nss_nis/nis-hosts.c @@ -19,11 +19,7 @@ #include <assert.h> #include <nss.h> #include <ctype.h> -/* The following is an ugly trick to avoid a prototype declaration for - _nss_nis_endgrent. */ -#define _nss_nis_endhostent _nss_nis_endhostent_XXX #include <netdb.h> -#undef _nss_nis_endhostent #include <string.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -90,10 +86,15 @@ static bool_t new_start = 1; static char *oldkey = NULL; static int oldkeylen = 0; - enum nss_status _nss_nis_sethostent (int stayopen) { + return _nss_nis_endhostent (); +} + +enum nss_status +_nss_nis_endhostent (void) +{ __libc_lock_lock (lock); new_start = 1; @@ -108,11 +109,7 @@ _nss_nis_sethostent (int stayopen) return NSS_STATUS_SUCCESS; } -/* Make _nss_nis_endhostent an alias of _nss_nis_sethostent. We do this - even though the prototypes don't match. The argument of sethostent - is used so this makes no difference. */ -strong_alias (_nss_nis_sethostent, _nss_nis_endhostent) - +libnss_nis_hidden_def (_nss_nis_endhostent) /* The calling function always need to get a lock first. */ static enum nss_status |