public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: libc-alpha@sourceware.org
Cc: szabolcs.nagy@arm.com, fweimer@redhat.com
Subject: [COMMITTED] misc: Use __ferror_unlocked instead of ferror
Date: Wed, 23 Dec 2020 07:31:07 +0530	[thread overview]
Message-ID: <20201223020107.1232629-1-siddhesh@sourceware.org> (raw)
In-Reply-To: <87pn31seis.fsf@oldenburg2.str.redhat.com>

The ferror results in an unnecessary PLT reference.  Use
__ferror_unlocked instead , which gets inlined.
---
 misc/mntent_r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 39fa08f2c6..b963c9af61 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -253,7 +253,7 @@ __addmntent (FILE *stream, const struct mntent *mnt)
   write_string (stream, mnt->mnt_opts);
   fprintf (stream, "%d %d\n", mnt->mnt_freq, mnt->mnt_passno);
 
-  ret = ferror (stream) != 0 || fflush (stream) != 0;
+  ret = __ferror_unlocked (stream) != 0 || fflush (stream) != 0;
 
   funlockfile (stream);
 
-- 
2.29.2


      reply	other threads:[~2020-12-23  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 10:08 [PATCH v2] addmntent: Remove unbounded alloca usage from getmntent [BZ#27083] Siddhesh Poyarekar
2020-12-22 10:16 ` Florian Weimer
2020-12-22 21:15 ` Szabolcs Nagy
2020-12-22 21:43   ` Florian Weimer
2020-12-23  2:01     ` Siddhesh Poyarekar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201223020107.1232629-1-siddhesh@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=szabolcs.nagy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).