[glibc] misc: Use __ferror_unlocked instead of ferror

Siddhesh Poyarekar siddhesh@sourceware.org
Wed Dec 23 02:01:06 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=be37b807053d7bd4b33b9d74dc97860fc58335d5

commit be37b807053d7bd4b33b9d74dc97860fc58335d5
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Wed Dec 23 07:03:42 2020 +0530

    misc: Use __ferror_unlocked instead of ferror
    
    The ferror results in an unnecessary PLT reference.  Use
    __ferror_unlocked instead , which gets inlined.

Diff:
---
 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);


More information about the Glibc-cvs mailing list