diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-03-05 05:58:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-03-05 05:58:41 +0000 |
commit | e300f4db52ddfcdfbf8a53d69d88e037365cb7a3 (patch) | |
tree | edc94f3db1aa4b8d5dfc6192d153023fb32d9a0d /wiretap/wtap.c | |
parent | a7553a55864b398593c9e3c922d91ae804e0d732 (diff) | |
download | wireshark-e300f4db52ddfcdfbf8a53d69d88e037365cb7a3.tar.gz wireshark-e300f4db52ddfcdfbf8a53d69d88e037365cb7a3.tar.bz2 wireshark-e300f4db52ddfcdfbf8a53d69d88e037365cb7a3.zip |
Have "wtap_seek_read()" return 0 on success and -1 on failure, and take
an "err" argument that points to an "int" into which to put an error
code if it fails.
Check for errors in one call to it, and note that we should do so in
other places.
In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite
"cfile.pseudo_header", and make the buffer into which we read the data
WTAP_MAX_PACKET_SIZE bytes, as it should be.
In some of the file readers for text files, check for errors from the
"parse the record header" and "parse the hex dump" routines when reading
sequentially.
In "csids_seek_read()", fix some calls to "file_error()" to check the
error on the random stream (that being what we're reading).
svn path=/trunk/; revision=4874
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r-- | wiretap/wtap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c index b9ba2e1558..2bc0191f99 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1,6 +1,6 @@ /* wtap.c * - * $Id: wtap.c,v 1.61 2002/02/07 20:41:28 guy Exp $ + * $Id: wtap.c,v 1.62 2002/03/05 05:58:41 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -18,8 +18,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ + #include <string.h> #include <errno.h> @@ -312,7 +312,9 @@ wtap_loop(wtap *wth, int count, wtap_handler callback, u_char* user, int *err) int wtap_seek_read(wtap *wth, long seek_off, - union wtap_pseudo_header *pseudo_header, guint8 *pd, int len) + union wtap_pseudo_header *pseudo_header, guint8 *pd, int len, + int *err) { - return wth->subtype_seek_read(wth, seek_off, pseudo_header, pd, len); + return wth->subtype_seek_read(wth, seek_off, pseudo_header, pd, len, + err); } |