[PATCH 9/7] nss_nis: Use NSS_DECLARE_MODULE_FUNCTIONS

Andreas Schwab schwab@suse.de
Thu Feb 13 09:16:00 GMT 2020


On Feb 13 2020, Florian Weimer wrote:

> diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c
> index 2d08076382..1ee5444cfc 100644
> --- a/nis/nss_nis/nis-hosts.c
> +++ b/nis/nss_nis/nis-hosts.c
> @@ -90,9 +90,16 @@ static bool_t new_start = 1;
>  static char *oldkey = NULL;
>  static int oldkeylen = 0;
>  
> +hidden_proto (_nss_nis_endhostent)
>  
>  enum nss_status
>  _nss_nis_sethostent (int stayopen)
> +{
> +  return _nss_nis_endhostent ();
> +}
> +
> +enum nss_status
> +_nss_nis_endhostent (void)
>  {
>    __libc_lock_lock (lock);
>  
> @@ -108,11 +115,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)
> -
> +hidden_def (_nss_nis_endhostent)

Please also remove the #define/#undef above.

> diff --git a/nis/nss_nis/nis-network.c b/nis/nss_nis/nis-network.c
> index dcafd26148..511de00bd3 100644
> --- a/nis/nss_nis/nis-network.c
> +++ b/nis/nss_nis/nis-network.c
> @@ -45,10 +45,18 @@ static bool_t new_start = 1;
>  static char *oldkey;
>  static int oldkeylen;
>  
> +hidden_proto (_nss_nis_endnetent)
> +
>  enum nss_status
>  _nss_nis_setnetent (int stayopen)
>  {
> -  __libc_lock_lock (lock);
> +  return _nss_nis_endnetent ();
> +}
> +
> +enum nss_status
> +_nss_nis_endnetent (void)
> +{
> +__libc_lock_lock (lock);
>  
>    new_start = 1;
>    if (oldkey != NULL)
> @@ -62,10 +70,7 @@ _nss_nis_setnetent (int stayopen)
>  
>    return NSS_STATUS_SUCCESS;
>  }
> -/* Make _nss_nis_endnetent an alias of _nss_nis_setnetent.  We do this
> -   even though the prototypes don't match.  The argument of setnetent
> -   is not used so this makes no difference.  */
> -strong_alias (_nss_nis_setnetent, _nss_nis_endnetent)
> +hidden_def (_nss_nis_endnetent)

Likewise.

> diff --git a/nis/nss_nis/nis-spwd.c b/nis/nss_nis/nis-spwd.c
> index 6cd46b4022..660447b544 100644
> --- a/nis/nss_nis/nis-spwd.c
> +++ b/nis/nss_nis/nis-spwd.c
> @@ -46,8 +46,16 @@ static bool ent_adjunct_used;
>  static char *oldkey;
>  static int oldkeylen;
>  
> +hidden_proto (_nss_nis_endspent)
> +
>  enum nss_status
>  _nss_nis_setspent (int stayopen)
> +{
> +  return _nss_nis_endspent ();
> +}
> +
> +enum nss_status
> +_nss_nis_endspent (void)
>  {
>    __libc_lock_lock (lock);
>  
> @@ -61,10 +69,7 @@ _nss_nis_setspent (int stayopen)
>  
>    return NSS_STATUS_SUCCESS;
>  }
> -/* Make _nss_nis_endspent an alias of _nss_nis_setspent.  We do this
> -   even though the prototypes don't match.  The argument of setspent
> -   is not used so this makes no difference.  */
> -strong_alias (_nss_nis_setspent, _nss_nis_endspent)
> +hidden_def (_nss_nis_endspent)

Likewise.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



More information about the Libc-alpha mailing list