From f8346498604f417415c131e3c6dbf66e6643254e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 25 Jul 2019 14:16:10 +0200 Subject: Replace reads in squashfs with positional reads In most cases, we know exactely where the data that we want to read is on disk, so instead of using read() on the squashfs (or lseek + read), the code can in many places be cleaned up to use the pread wrapper read_data_at instead. Signed-off-by: David Oberhollenzer --- lib/comp/compressor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/comp') diff --git a/lib/comp/compressor.c b/lib/comp/compressor.c index ce88bdd..fd67257 100644 --- a/lib/comp/compressor.c +++ b/lib/comp/compressor.c @@ -77,8 +77,8 @@ int generic_read_options(int fd, void *data, size_t size) { uint8_t buffer[size + 2]; - if (read_data("reading compressor options", - fd, buffer, sizeof(buffer))) { + if (read_data_at("reading compressor options", sizeof(sqfs_super_t), + fd, buffer, sizeof(buffer))) { return -1; } -- cgit v1.2.3