aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/lanalyzer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-06-07 07:27:35 +0000
committerGuy Harris <guy@alum.mit.edu>2002-06-07 07:27:35 +0000
commit2aad75bb826b45ee1a78be2bbe2687e488748f8b (patch)
treefc165ec22e943d3b15a10b6c8c84359286432e05 /wiretap/lanalyzer.c
parentc15486768a2d90fcf97ca8ea628f3d174ad11a5b (diff)
downloadwireshark-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/lanalyzer.c')
-rw-r--r--wiretap/lanalyzer.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c
index 6372e99c03..45b5e5b8f0 100644
--- a/wiretap/lanalyzer.c
+++ b/wiretap/lanalyzer.c
@@ -1,6 +1,6 @@
/* lanalyzer.c
*
- * $Id: lanalyzer.c,v 1.32 2002/05/23 06:34:10 guy Exp $
+ * $Id: lanalyzer.c,v 1.33 2002/06/07 07:27:35 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -90,8 +90,7 @@ int lanalyzer_open(wtap *wth, int *err)
/* Read records until we find the start of packets */
while (1) {
- if (file_seek(wth->fh, record_length, SEEK_CUR) == -1) {
- *err = file_error(wth->fh);
+ if (file_seek(wth->fh, record_length, SEEK_CUR, err) == -1) {
g_free(wth->capture.lanalyzer);
return -1;
}
@@ -184,8 +183,7 @@ int lanalyzer_open(wtap *wth, int *err)
case REC_TRACE_PACKET_DATA:
/* Go back header number ob ytes so that lanalyzer_read
* can read this header */
- if (file_seek(wth->fh, -bytes_read, SEEK_CUR) == -1) {
- *err = file_error(wth->fh);
+ if (file_seek(wth->fh, -bytes_read, SEEK_CUR, err) == -1) {
g_free(wth->capture.lanalyzer);
return -1;
}