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/pppdump.c | |
parent | c15486768a2d90fcf97ca8ea628f3d174ad11a5b (diff) | |
download | wireshark-2aad75bb826b45ee1a78be2bbe2687e488748f8b.tar.gz |
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/pppdump.c')
-rw-r--r-- | wiretap/pppdump.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c index d11aeaf6bd..d267ea914a 100644 --- a/wiretap/pppdump.c +++ b/wiretap/pppdump.c @@ -1,6 +1,6 @@ /* pppdump.c * - * $Id: pppdump.c,v 1.18 2002/05/29 02:11:57 guy Exp $ + * $Id: pppdump.c,v 1.19 2002/06/07 07:27:35 guy Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -195,10 +195,8 @@ pppdump_open(wtap *wth, int *err) my_file_type: - if (file_seek(wth->fh, 5, SEEK_SET) == -1) { - *err = file_error(wth->fh); + if (file_seek(wth->fh, 5, SEEK_SET, err) == -1) return -1; - } state = wth->capture.generic = g_malloc(sizeof(pppdump_t)); state->timestamp = pntohl(&buffer[1]); @@ -546,10 +544,8 @@ pppdump_seek_read (wtap *wth, return FALSE; } - if (file_seek(wth->random_fh, pid->offset, SEEK_SET) == -1) { - *err = file_error(wth->random_fh); + if (file_seek(wth->random_fh, pid->offset, SEEK_SET, err) == -1) return FALSE; - } init_state(state->seek_state); |