diff options
Diffstat (limited to 'wiretap/snoop.c')
-rw-r--r-- | wiretap/snoop.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/wiretap/snoop.c b/wiretap/snoop.c index 124ef543f9..62713f3628 100644 --- a/wiretap/snoop.c +++ b/wiretap/snoop.c @@ -1,6 +1,6 @@ /* snoop.c * - * $Id: snoop.c,v 1.42 2002/03/02 20:41:07 guy Exp $ + * $Id: snoop.c,v 1.43 2002/03/05 05:58:40 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -58,7 +58,7 @@ struct snooprec_hdr { static gboolean snoop_read(wtap *wth, int *err, long *data_offset); static int snoop_seek_read(wtap *wth, long seek_off, - union wtap_pseudo_header *pseudo_header, u_char *pd, int length); + union wtap_pseudo_header *pseudo_header, u_char *pd, int length, int *err); static int snoop_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header, int *err); static int snoop_read_rec_data(FILE_T fh, u_char *pd, int length, int *err); @@ -404,16 +404,18 @@ static gboolean snoop_read(wtap *wth, int *err, long *data_offset) static int snoop_seek_read(wtap *wth, long seek_off, - union wtap_pseudo_header *pseudo_header, u_char *pd, int length) + union wtap_pseudo_header *pseudo_header, u_char *pd, int length, int *err) { int ret; - int err; /* XXX - return this */ - file_seek(wth->random_fh, seek_off, SEEK_SET); + if (file_seek(wth->random_fh, seek_off, SEEK_SET) == -1) { + *err = file_error(wth->random_fh); + return -1; + } if (wth->file_encap == WTAP_ENCAP_ATM_SNIFFER) { ret = snoop_read_atm_pseudoheader(wth->random_fh, pseudo_header, - &err); + err); if (ret < 0) { /* Read error */ return ret; @@ -423,7 +425,7 @@ snoop_seek_read(wtap *wth, long seek_off, /* * Read the packet data. */ - return snoop_read_rec_data(wth->random_fh, pd, length, &err); + return snoop_read_rec_data(wth->random_fh, pd, length, err); } static int |