From 4a6f090f05ef6959a547b3d40940897d879ce050 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 26 May 2014 21:22:23 -0500 Subject: [PATCH] resource.c: Don't call lseek() if not necessary To be reading a pipable resource from a pipe, is_pipable must be set in the 'struct wim_resource_spec', so check that first before calling filedes_is_seekable(). --- src/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resource.c b/src/resource.c index 5c0225ab..d2a4c309 100644 --- a/src/resource.c +++ b/src/resource.c @@ -169,7 +169,7 @@ read_compressed_wim_resource(const struct wim_resource_spec * const rspec, struct filedes * const in_fd = &rspec->wim->in_fd; /* Determine if we're reading a pipable resource from a pipe or not. */ - const bool is_pipe_read = !filedes_is_seekable(in_fd); + const bool is_pipe_read = (rspec->is_pipable && !filedes_is_seekable(in_fd)); /* Determine if the chunk table is in an altenate format. */ const bool alt_chunk_table = (rspec->flags & WIM_RESHDR_FLAG_PACKED_STREAMS) -- 2.43.0