From 895c6f0664d19f754fe3905bae1bae83aee46bd0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 7 Mar 2021 02:31:45 +0100 Subject: [PATCH] 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 d6e8d542de..1159ee8005 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/lib/mountlist.c b/lib/mountlist.c index fae5b601ba..27989d271c 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 7542048e45..8ec4793355 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.39.5