[2/3] login: Rework hidden prototypes for __setutent, __utmpname, __endutent

Message ID 16b3eb68f21df794606763f02c37bd114d3e0b74.1624275874.git.fweimer@redhat.com
State Committed
Commit 98164ba55d01dfe517a71cbc5538ff1f5dc563d6
Delegated to: Adhemerval Zanella Netto
Headers
Series Move libutil into libc |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Florian Weimer June 21, 2021, 11:46 a.m. UTC
  Replace attribute_hidden with a regular combination of
libc_hidden_proto and libc_hidden_def.
---
 include/utmp.h     | 9 ++++++---
 login/getutent_r.c | 2 ++
 login/utmpname.c   | 1 +
 3 files changed, 9 insertions(+), 3 deletions(-)
  

Comments

Adhemerval Zanella Netto June 29, 2021, 1:22 p.m. UTC | #1
LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

On 21/06/2021 08:46, Florian Weimer via Libc-alpha wrote:
> Replace attribute_hidden with a regular combination of
> libc_hidden_proto and libc_hidden_def.
> ---
>  include/utmp.h     | 9 ++++++---
>  login/getutent_r.c | 2 ++
>  login/utmpname.c   | 1 +
>  3 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/include/utmp.h b/include/utmp.h
> index 374184e9b2..e8162bd08d 100644
> --- a/include/utmp.h
> +++ b/include/utmp.h
> @@ -6,11 +6,14 @@
>  /* Now define the internal interfaces.  */
>  extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp);
>  libc_hidden_proto (__updwtmp)
> -extern int __utmpname (const char *__file) attribute_hidden;
> +extern int __utmpname (const char *__file);
> +libc_hidden_proto (__utmpname)
>  extern struct utmp *__getutent (void);
>  libc_hidden_proto (__getutent)
> -extern void __setutent (void) attribute_hidden;
> -extern void __endutent (void) attribute_hidden;
> +extern void __setutent (void);
> +libc_hidden_proto (__setutent)
> +extern void __endutent (void);
> +libc_hidden_proto (__endutent)
>  extern struct utmp *__getutid (const struct utmp *__id);
>  libc_hidden_proto (__getutid)
>  extern struct utmp *__getutline (const struct utmp *__line);
> diff --git a/login/getutent_r.c b/login/getutent_r.c
> index 0af48acec8..58d3d5fd0c 100644
> --- a/login/getutent_r.c
> +++ b/login/getutent_r.c
> @@ -36,6 +36,7 @@ __setutent (void)
>  
>    __libc_lock_unlock (__libc_utmp_lock);
>  }
> +libc_hidden_def (__setutent)
>  weak_alias (__setutent, setutent)
>  
>  
> @@ -82,4 +83,5 @@ __endutent (void)
>  
>    __libc_lock_unlock (__libc_utmp_lock);
>  }
> +libc_hidden_def (__endutent)
>  weak_alias (__endutent, endutent)
> diff --git a/login/utmpname.c b/login/utmpname.c
> index c85c27fe68..a645445e8a 100644
> --- a/login/utmpname.c
> +++ b/login/utmpname.c
> @@ -72,4 +72,5 @@ done:
>    __libc_lock_unlock (__libc_utmp_lock);
>    return result;
>  }
> +libc_hidden_def (__utmpname)
>  weak_alias (__utmpname, utmpname)
>
  

Patch

diff --git a/include/utmp.h b/include/utmp.h
index 374184e9b2..e8162bd08d 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -6,11 +6,14 @@ 
 /* Now define the internal interfaces.  */
 extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp);
 libc_hidden_proto (__updwtmp)
-extern int __utmpname (const char *__file) attribute_hidden;
+extern int __utmpname (const char *__file);
+libc_hidden_proto (__utmpname)
 extern struct utmp *__getutent (void);
 libc_hidden_proto (__getutent)
-extern void __setutent (void) attribute_hidden;
-extern void __endutent (void) attribute_hidden;
+extern void __setutent (void);
+libc_hidden_proto (__setutent)
+extern void __endutent (void);
+libc_hidden_proto (__endutent)
 extern struct utmp *__getutid (const struct utmp *__id);
 libc_hidden_proto (__getutid)
 extern struct utmp *__getutline (const struct utmp *__line);
diff --git a/login/getutent_r.c b/login/getutent_r.c
index 0af48acec8..58d3d5fd0c 100644
--- a/login/getutent_r.c
+++ b/login/getutent_r.c
@@ -36,6 +36,7 @@  __setutent (void)
 
   __libc_lock_unlock (__libc_utmp_lock);
 }
+libc_hidden_def (__setutent)
 weak_alias (__setutent, setutent)
 
 
@@ -82,4 +83,5 @@  __endutent (void)
 
   __libc_lock_unlock (__libc_utmp_lock);
 }
+libc_hidden_def (__endutent)
 weak_alias (__endutent, endutent)
diff --git a/login/utmpname.c b/login/utmpname.c
index c85c27fe68..a645445e8a 100644
--- a/login/utmpname.c
+++ b/login/utmpname.c
@@ -72,4 +72,5 @@  done:
   __libc_lock_unlock (__libc_utmp_lock);
   return result;
 }
+libc_hidden_def (__utmpname)
 weak_alias (__utmpname, utmpname)