public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix linknamespace errors in nss_database.c if build with -Os.
@ 2020-12-10 10:31 Stefan Liebler
  2020-12-10 10:37 ` Stefan Liebler
  2020-12-10 22:28 ` DJ Delorie
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Liebler @ 2020-12-10 10:31 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stefan Liebler

Starting with recent commits, I get 43 conform/.../linknamespace FAILs:
- nss: Introduce <nss_module.h>
- <nss_action.h>: New abstraction for combining NSS modules and NSS actions
- nss: Implement <nss_database.h> (see nss/nss_database.c)
- nsswitch: use new internal API (core)
- nsswitch: user new internal API (tests)
- nsswitch: use new internal API (callers)

e.g. conform/XPG42/wordexp.h/linknamespace.out
[initial] wordexp -> [libc.a(wordexp.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_database_get -> [libc.a(nss_database.o)] feof_unlocked
[initial] wordexp -> [libc.a(wordexp.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_database_get -> [libc.a(nss_database.o)] ferror_unlocked

This patch is just using __ferror_unlocked and __feof_unlocked instead of the
non "__" prefixed ones.
---
 nss/nss_database.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nss/nss_database.c b/nss/nss_database.c
index e8c307d1f3..6ff537152f 100644
--- a/nss/nss_database.c
+++ b/nss/nss_database.c
@@ -271,9 +271,9 @@ nss_database_reload_1 (struct nss_database_data *data, FILE *fp)
   while (true)
     {
       ssize_t ret = __getline (&line, &line_allocated, fp);
-      if (ferror_unlocked (fp))
+      if (__ferror_unlocked (fp))
         break;
-      if (feof_unlocked (fp))
+      if (__feof_unlocked (fp))
         {
           result = true;
           break;
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix linknamespace errors in nss_database.c if build with -Os.
  2020-12-10 10:31 [PATCH] Fix linknamespace errors in nss_database.c if build with -Os Stefan Liebler
@ 2020-12-10 10:37 ` Stefan Liebler
  2020-12-10 22:28 ` DJ Delorie
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Liebler @ 2020-12-10 10:37 UTC (permalink / raw)
  To: GNU C Library

Hi DJ,

Sorry, forgot to CC you. Can you please have a look?

Bye,
Stefan

On 12/10/20 11:31 AM, Stefan Liebler wrote:
> Starting with recent commits, I get 43 conform/.../linknamespace FAILs:
> - nss: Introduce <nss_module.h>
> - <nss_action.h>: New abstraction for combining NSS modules and NSS actions
> - nss: Implement <nss_database.h> (see nss/nss_database.c)
> - nsswitch: use new internal API (core)
> - nsswitch: user new internal API (tests)
> - nsswitch: use new internal API (callers)
> 
> e.g. conform/XPG42/wordexp.h/linknamespace.out
> [initial] wordexp -> [libc.a(wordexp.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_database_get -> [libc.a(nss_database.o)] feof_unlocked
> [initial] wordexp -> [libc.a(wordexp.o)] __getpwnam_r -> [libc.a(getpwnam_r.o)] __nss_database_custom -> [libc.a(nsswitch.o)] __nss_database_get -> [libc.a(nss_database.o)] ferror_unlocked
> 
> This patch is just using __ferror_unlocked and __feof_unlocked instead of the
> non "__" prefixed ones.
> ---
>  nss/nss_database.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/nss/nss_database.c b/nss/nss_database.c
> index e8c307d1f3..6ff537152f 100644
> --- a/nss/nss_database.c
> +++ b/nss/nss_database.c
> @@ -271,9 +271,9 @@ nss_database_reload_1 (struct nss_database_data *data, FILE *fp)
>    while (true)
>      {
>        ssize_t ret = __getline (&line, &line_allocated, fp);
> -      if (ferror_unlocked (fp))
> +      if (__ferror_unlocked (fp))
>          break;
> -      if (feof_unlocked (fp))
> +      if (__feof_unlocked (fp))
>          {
>            result = true;
>            break;
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix linknamespace errors in nss_database.c if build with -Os.
  2020-12-10 10:31 [PATCH] Fix linknamespace errors in nss_database.c if build with -Os Stefan Liebler
  2020-12-10 10:37 ` Stefan Liebler
@ 2020-12-10 22:28 ` DJ Delorie
  2020-12-11  8:44   ` Stefan Liebler
  1 sibling, 1 reply; 4+ messages in thread
From: DJ Delorie @ 2020-12-10 22:28 UTC (permalink / raw)
  To: Stefan Liebler; +Cc: libc-alpha


Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org> writes:
>        ssize_t ret = __getline (&line, &line_allocated, fp);
> -      if (ferror_unlocked (fp))
> +      if (__ferror_unlocked (fp))
>          break;
> -      if (feof_unlocked (fp))
> +      if (__feof_unlocked (fp))
>          {

LGTM.  Thanks!

Reviewed-by: DJ Delorie <dj@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix linknamespace errors in nss_database.c if build with -Os.
  2020-12-10 22:28 ` DJ Delorie
@ 2020-12-11  8:44   ` Stefan Liebler
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Liebler @ 2020-12-11  8:44 UTC (permalink / raw)
  To: DJ Delorie; +Cc: libc-alpha

On 12/10/20 11:28 PM, DJ Delorie wrote:
> 
> Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org> writes:
>>        ssize_t ret = __getline (&line, &line_allocated, fp);
>> -      if (ferror_unlocked (fp))
>> +      if (__ferror_unlocked (fp))
>>          break;
>> -      if (feof_unlocked (fp))
>> +      if (__feof_unlocked (fp))
>>          {
> 
> LGTM.  Thanks!
> 
> Reviewed-by: DJ Delorie <dj@redhat.com>
> 

Committed.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-11  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 10:31 [PATCH] Fix linknamespace errors in nss_database.c if build with -Os Stefan Liebler
2020-12-10 10:37 ` Stefan Liebler
2020-12-10 22:28 ` DJ Delorie
2020-12-11  8:44   ` Stefan Liebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).