summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-03-07 02:36:31 +0100
committerBruno Haible <bruno@clisp.org>2021-03-07 11:01:58 +0100
commitd26b0a2672f5adec9658ac606661b2f3b24c0336 (patch)
treeed06bbb504b60f8df858b0354ae4ecb712da4051
parent895c6f0664d19f754fe3905bae1bae83aee46bd0 (diff)
downloadgnulib-d26b0a2672f5adec9658ac606661b2f3b24c0336.tar.gz
gnulib-d26b0a2672f5adec9658ac606661b2f3b24c0336.tar.bz2
readutmp: Optimize stdio accesses.
* lib/readutmp.c: Include unlocked-io.h unconditionally. * modules/readutmp (Depends-on): Add unlocked-io-internal.
-rw-r--r--ChangeLog6
-rw-r--r--lib/readutmp.c5
-rw-r--r--modules/readutmp1
3 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1159ee8005..47f68070bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2021-03-06 Bruno Haible <bruno@clisp.org>
+ 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 <bruno@clisp.org>
+
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 26ad815438..73db856c5d 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 e88897c999..18cdad10f8 100644
--- a/modules/readutmp
+++ b/modules/readutmp
@@ -12,6 +12,7 @@ xalloc
stdbool
stdint
fopen-gnu
+unlocked-io-internal
configure.ac:
gl_READUTMP

Return to:

Send suggestions and report system problems to the System administrator.