>From 895c6f0664d19f754fe3905bae1bae83aee46bd0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 7 Mar 2021 02:31:45 +0100 Subject: [PATCH 4/9] mountlist: Optimize stdio accesses. * lib/mountlist.c: Include unlocked-io.h unconditionally. * modules/mountlist (Depends-on): Add unlocked-io-internal. --- ChangeLog | 6 ++++++ lib/mountlist.c | 5 ++--- modules/mountlist | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6e8d54..1159ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 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. + +2021-03-06 Bruno Haible + getusershell: Optimize stdio accesses when possible. * lib/getusershell.c: Test GNULIB_GETUSERSHELL_SINGLE_THREAD instead of USE_UNLOCKED_IO. diff --git a/lib/mountlist.c b/lib/mountlist.c index fae5b60..27989d2 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -149,9 +149,8 @@ # define MNT_IGNORE(M) 0 #endif -#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" /* The results of opendir() in this file are not used with dirfd and fchdir, therefore save some unnecessary work in fchdir.c. */ diff --git a/modules/mountlist b/modules/mountlist index 7542048..8ec4793 100644 --- a/modules/mountlist +++ b/modules/mountlist @@ -11,6 +11,7 @@ Depends-on: fopen-gnu getline open +unlocked-io-internal stdbool stdint strstr-simple -- 2.7.4