aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_wrappers.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-05-09 08:12:26 +0000
committerGuy Harris <guy@alum.mit.edu>2011-05-09 08:12:26 +0000
commit3de2b1be7405adac31bd796f3380b9d8edbe0f99 (patch)
treeb444b752e4435e0b436bbf8eef5c96af9f35a2de /wiretap/file_wrappers.c
parent88a1ed85e3156e80c3fed4848d651aae433dc8d8 (diff)
Get rid of the fd member of a wth structure; the FILE_T's in that
structure include a file descriptor. Add a wtap_fstat() for the file readers that use file times to generate time stamps (we really need a way to say "this file has no time stamps" or "this file has only relative time stamps). svn path=/trunk/; revision=37026
Diffstat (limited to 'wiretap/file_wrappers.c')
-rw-r--r--wiretap/file_wrappers.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index ee3ead8099..bd4207d885 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -1006,11 +1006,23 @@ file_tell(FILE_T stream)
return stream->pos + (stream->seek ? stream->skip : 0);
}
-gint64 file_tell_raw(FILE_T stream)
+gint64
+file_tell_raw(FILE_T stream)
{
return stream->raw_pos;
}
+int
+file_fstat(FILE_T stream, ws_statb64 *statb, int *err)
+{
+ if (ws_fstat64(stream->fd, statb) == -1) {
+ if (err != NULL)
+ *err = errno;
+ return -1;
+ }
+ return 0;
+}
+
int
file_read(void *buf, unsigned int len, FILE_T file)
{
@@ -1206,7 +1218,7 @@ file_close(FILE_T file)
file->err = 0;
file->err_info = NULL;
g_free(file);
- return close(fd);
+ return ws_close(fd);
}
#ifdef HAVE_LIBZ