>From d26b0a2672f5adec9658ac606661b2f3b24c0336 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 7 Mar 2021 02:36:31 +0100 Subject: [PATCH 5/9] readutmp: Optimize stdio accesses. * lib/readutmp.c: Include unlocked-io.h unconditionally. * modules/readutmp (Depends-on): Add unlocked-io-internal. --- ChangeLog | 6 ++++++ lib/readutmp.c | 5 ++--- modules/readutmp | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1159ee8..47f6807 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-03-06 Bruno Haible + readutmp: Optimize stdio accesses. + * lib/readutmp.c: Include unlocked-io.h unconditionally. + * modules/readutmp (Depends-on): Add unlocked-io-internal. + +2021-03-06 Bruno Haible + mountlist: Optimize stdio accesses. * lib/mountlist.c: Include unlocked-io.h unconditionally. * modules/mountlist (Depends-on): Add unlocked-io-internal. diff --git a/lib/readutmp.c b/lib/readutmp.c index 26ad815..73db856 100644 --- a/lib/readutmp.c +++ b/lib/readutmp.c @@ -34,9 +34,8 @@ #include "xalloc.h" -#if USE_UNLOCKED_IO -# include "unlocked-io.h" -#endif +/* Each of the FILE streams in this file is only used in a single thread. */ +#include "unlocked-io.h" #if 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wsizeof-pointer-memaccess" diff --git a/modules/readutmp b/modules/readutmp index e88897c..18cdad1 100644 --- a/modules/readutmp +++ b/modules/readutmp @@ -12,6 +12,7 @@ xalloc stdbool stdint fopen-gnu +unlocked-io-internal configure.ac: gl_READUTMP -- 2.7.4