diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-06-07 07:27:35 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-06-07 07:27:35 +0000 |
commit | 2aad75bb826b45ee1a78be2bbe2687e488748f8b (patch) | |
tree | fc165ec22e943d3b15a10b6c8c84359286432e05 /wiretap/etherpeek.c | |
parent | c15486768a2d90fcf97ca8ea628f3d174ad11a5b (diff) | |
download | wireshark-2aad75bb826b45ee1a78be2bbe2687e488748f8b.tar.gz wireshark-2aad75bb826b45ee1a78be2bbe2687e488748f8b.tar.bz2 wireshark-2aad75bb826b45ee1a78be2bbe2687e488748f8b.zip |
Graeme Hewson noted that zlib has a bug wherein "gzseek()" doesn't set
the internal z_err value for the stream if an "fseek()" call it makes
fails, so that if "gzerror()" is subsequently called, it returns Z_OK
rather than an error.
To work around this, we pass "file_seek()" an "int *err", and have the
with-zlib version of "file_seek()" check, if "gzseek()" fails, whether
the return value of "file_error()" is 0 and, if so, have it return
"errno" instead.
svn path=/trunk/; revision=5642
Diffstat (limited to 'wiretap/etherpeek.c')
-rw-r--r-- | wiretap/etherpeek.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/wiretap/etherpeek.c b/wiretap/etherpeek.c index ee55db7405..5818ffce94 100644 --- a/wiretap/etherpeek.c +++ b/wiretap/etherpeek.c @@ -2,7 +2,7 @@ * Routines for opening EtherPeek (and TokenPeek?) files * Copyright (c) 2001, Daniel Thompson <d.thompson@gmx.net> * - * $Id: etherpeek.c,v 1.19 2002/04/08 10:01:26 guy Exp $ + * $Id: etherpeek.c,v 1.20 2002/06/07 07:27:34 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -446,10 +446,8 @@ etherpeek_seek_read_v7(wtap *wth, long seek_off, { airopeek_radio_hdr_t radio_hdr; - if (file_seek(wth->random_fh, seek_off, SEEK_SET) == -1) { - *err = file_error(wth->random_fh); + if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) return FALSE; - } if (wth->file_encap == WTAP_ENCAP_IEEE_802_11_WITH_RADIO) { /* |