diff options
Diffstat (limited to 'wiretap/visual.c')
-rw-r--r-- | wiretap/visual.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c index 67a7d481f9..cfa03bceac 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -158,9 +158,9 @@ struct visual_write_info /* Local functions to handle file reads and writes */ -static int visual_read(wtap *wth, int *err, gchar **err_info, +static gboolean visual_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset); -static int visual_seek_read(wtap *wth, gint64 seek_off, +static gboolean visual_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info); static gboolean visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info); @@ -281,7 +281,7 @@ int visual_open(wtap *wth, int *err, gchar **err_info) in a loop to sequentially read the entire file one time. After the file has been read once, any Future access to the packets is done through seek_read. */ -static int visual_read(wtap *wth, int *err, gchar **err_info, +static gboolean visual_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) { struct visual_read_info *visual = (struct visual_read_info *)wth->priv; @@ -292,33 +292,31 @@ static int visual_read(wtap *wth, int *err, gchar **err_info, if (visual->current_pkt > visual->num_pkts) { *err = 0; /* it's just an EOF, not an error */ - return -1; + return FALSE; } visual->current_pkt++; *data_offset = file_tell(wth->fh); - if (!visual_read_packet(wth, wth->fh, &wth->phdr, wth->frame_buffer, - err, err_info)) - return -1; - return REC_TYPE_PACKET; + return visual_read_packet(wth, wth->fh, &wth->phdr, wth->frame_buffer, + err, err_info); } /* Read packet header and data for random access. */ -static int visual_seek_read(wtap *wth, gint64 seek_off, +static gboolean visual_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info) { /* Seek to the packet header */ if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) - return -1; + return FALSE; /* Read the packet. */ if (!visual_read_packet(wth, wth->random_fh, phdr, buf, err, err_info)) { if (*err == 0) *err = WTAP_ERR_SHORT_READ; - return -1; + return FALSE; } - return REC_TYPE_PACKET; + return TRUE; } static gboolean |