summaryrefslogtreecommitdiffstats
path: root/libdwfl/gzip.c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-06-09 18:21:36 +0200
committerMark Wielaard <mark@klomp.org>2020-06-09 18:21:36 +0200
commitc0d643e7d91fc002c9fecd83277c62a0e56ef76f (patch)
tree89b5cf6673baa2cb206fdf245f4e30fe884945ad /libdwfl/gzip.c
parent14030673602a4f331f348decd51e5f0160719f0e (diff)
parent5643e037cb7a38ed5d52f50421be706ea8014e3d (diff)
Merge tag 'elfutils-0.177' into mjw/RH-DTSdts-0.177
elfutils 0.177 release Conflicts: libebl/eblopenbackend.c Removed try_dlopen and csky. tests/run-strip-reloc.sh Removed csky tests.
Diffstat (limited to 'libdwfl/gzip.c')
-rw-r--r--libdwfl/gzip.c5
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);
}