diff options
Diffstat (limited to 'libdwfl/gzip.c')
-rw-r--r-- | libdwfl/gzip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c index c2c13baf..043d0b6e 100644 --- a/libdwfl/gzip.c +++ b/libdwfl/gzip.c @@ -139,14 +139,14 @@ open_stream (int fd, off_t start_offset, struct unzip_state *state) { int d = dup (fd); if (unlikely (d < 0)) - return DWFL_E_BADELF; + return DWFL_E_ERRNO; if (start_offset != 0) { off_t off = lseek (d, start_offset, SEEK_SET); if (off != start_offset) { close (d); - return DWFL_E_BADELF; + return DWFL_E_ERRNO; } } state->zf = gzdopen (d, "r"); @@ -288,6 +288,7 @@ unzip (int fd, off_t start_offset, if (result == DWFL_E_NOERROR && gzdirect (state.zf)) { gzclose (state.zf); + /* Not a compressed stream after all. */ return fail (&state, DWFL_E_BADELF); } |