aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-08-28 01:19:45 +0000
committerGuy Harris <guy@alum.mit.edu>1999-08-28 01:19:45 +0000
commitae53260d0213cb805bcd84ee13045dd1f8a42e9c (patch)
tree3bdd6153eed5e75a235ad53a9bc3727bf40c0a57 /wiretap/file.c
parentf7951bd593675a2e958e0ba7c37c93533bd6e39e (diff)
Keep in the "wtap" structure the current offset into the file being
read, and maintain it ourselves as we read through the file, rather than calling "ftell()" for every packet we read - "ftell()" may involve an "lseek()" call, which could add a noticeable CPU overhead when reading a large file. svn path=/trunk/; revision=596
Diffstat (limited to 'wiretap/file.c')
-rw-r--r--wiretap/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wiretap/file.c b/wiretap/file.c
index 3e75cf1215..1a193a6602 100644
--- a/wiretap/file.c
+++ b/wiretap/file.c
@@ -1,6 +1,6 @@
/* file.c
*
- * $Id: file.c,v 1.18 1999/08/22 02:29:38 guy Exp $
+ * $Id: file.c,v 1.19 1999/08/28 01:19:43 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
@@ -105,6 +105,7 @@ wtap* wtap_open_offline(const char *filename, int *err)
/* initialization */
wth->file_encap = WTAP_ENCAP_UNKNOWN;
+ wth->data_offset = 0;
/* Try all file types */
for (i = 0; i < N_FILE_TYPES; i++) {