From: Tobias Stoeckmann Date: Thu, 17 Oct 2024 08:09:34 +0000 (+0200) Subject: libkmod: Use fread_unlocked X-Git-Tag: v34~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daccf4613f1cd26a62b753726771f5c8d87e09e3;p=thirdparty%2Fkmod.git libkmod: Use fread_unlocked This is in sync with read_char, which uses getc_unlocked. This and previous FILE based index adjustments improved FILE based index dump performance by 8 %. Signed-off-by: Tobias Stoeckmann Link: https://github.com/kmod-project/kmod/pull/190 Signed-off-by: Lucas De Marchi --- diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index 64a38979..2ed8752d 100644 --- a/libkmod/libkmod-index.c +++ b/libkmod/libkmod-index.c @@ -183,7 +183,7 @@ static bool read_u32s(FILE *in, uint32_t *l, size_t n) size_t i; errno = 0; - if (fread(l, sizeof(uint32_t), n, in) != n) { + if (fread_unlocked(l, sizeof(uint32_t), n, in) != n) { errno = EINVAL; return false; }