From: Eric Biggers Date: Tue, 27 May 2014 02:22:23 +0000 (-0500) Subject: resource.c: Don't call lseek() if not necessary X-Git-Tag: v1.7.0~81 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=4a6f090f05ef6959a547b3d40940897d879ce050 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(). --- 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)