aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-05-09 05:30:59 +0000
committerGuy Harris <guy@alum.mit.edu>2011-05-09 05:30:59 +0000
commit88a1ed85e3156e80c3fed4848d651aae433dc8d8 (patch)
treeab444a6fa6b32f20c68c7689470957750b11e699 /wiretap/wtap.c
parent42ba70cf9c7b906c73721065e5b7425bf2ff663e (diff)
From Jakub Zawadzki: for file read progress bars, use the raw offset in
the file, rather than the offset in the uncompressed data stream. That way we don't get the "hey, we're more than 100% into the file, better refigure this" surprise. svn path=/trunk/; revision=37025
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r--wiretap/wtap.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 411d6fc45a..145567a975 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -736,17 +736,9 @@ wtap_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
* from the file so far. (gint64, in case that's 64 bits.)
*/
gint64
-wtap_read_so_far(wtap *wth, int *err)
+wtap_read_so_far(wtap *wth)
{
- gint64 file_pos;
-
- file_pos = ws_lseek64(wth->fd, 0, SEEK_CUR);
- if (file_pos == -1) {
- if (err != NULL)
- *err = errno;
- return -1;
- }
- return file_pos;
+ return file_tell_raw(wth->fh);
}
struct wtap_pkthdr*