summaryrefslogtreecommitdiff
path: root/wiretap/netmon.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-17 09:20:13 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-17 09:20:13 +0000
commit05a8c94ddf4bc48888d3dfbdcfff3eddc0f15093 (patch)
tree97ab76474fb96e5d33e9769d8a50ed6f584bbe9f /wiretap/netmon.c
parent2e52e2ac997ca58caabee3270b5a6c3f96159ff0 (diff)
downloadwireshark-05a8c94ddf4bc48888d3dfbdcfff3eddc0f15093.tar.gz
From beroset:
implemented wtap_dump_file_seek() and _tell() implemented the previously declared but unimplemented wtap_dump_file_seek() and wtap_dump_file_tell() functions and used them in the seven files that had previously used a plain ftell or fseek and added error checking as appropriate. I also added a new error WTAP_ERR_CANT_SEEK_COMPRESSED and put it next to WTAP_ERR_CANT_SEEK causing renumbering of two of the existing error codes. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48348
Diffstat (limited to 'wiretap/netmon.c')
-rw-r--r--wiretap/netmon.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index 1c54eb3e15..0a7632475a 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -983,10 +983,8 @@ gboolean netmon_dump_open(wtap_dumper *wdh, int *err)
haven't yet written any packets. As we'll have to rewrite
the header when we've written out all the packets, we just
skip over the header for now. */
- if (fseek(wdh->fh, CAPTUREFILE_HEADER_SIZE, SEEK_SET) == -1) {
- *err = errno;
+ if (wtap_dump_file_seek(wdh, CAPTUREFILE_HEADER_SIZE, SEEK_SET, err) == -1)
return FALSE;
- }
wdh->subtype_write = netmon_dump;
wdh->subtype_close = netmon_dump_close;
@@ -1234,7 +1232,8 @@ static gboolean netmon_dump_close(wtap_dumper *wdh, int *err)
return FALSE;
/* Now go fix up the file header. */
- fseek(wdh->fh, 0, SEEK_SET);
+ if (wtap_dump_file_seek(wdh, 0, SEEK_SET, err) == -1)
+ return FALSE;
memset(&file_hdr, '\0', sizeof file_hdr);
switch (wdh->file_type) {