diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-03-17 09:20:13 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-03-17 09:20:13 +0000 |
commit | 05a8c94ddf4bc48888d3dfbdcfff3eddc0f15093 (patch) | |
tree | 97ab76474fb96e5d33e9769d8a50ed6f584bbe9f /wiretap/visual.c | |
parent | 2e52e2ac997ca58caabee3270b5a6c3f96159ff0 (diff) |
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/visual.c')
-rw-r--r-- | wiretap/visual.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c index 33fe043f7d..1d59f8c6eb 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -684,10 +684,8 @@ gboolean visual_dump_open(wtap_dumper *wdh, int *err) /* All of the fields in the file header aren't known yet so just skip over it for now. It will be created after all of the packets have been written. */ - 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; - } return TRUE; } @@ -834,7 +832,8 @@ static gboolean visual_dump_close(wtap_dumper *wdh, int *err) } /* Write the magic number at the start of the file. */ - fseek(wdh->fh, 0, SEEK_SET); + if (wtap_dump_file_seek(wdh, 0, SEEK_SET, err) == -1) + return FALSE; magicp = visual_magic; magic_size = sizeof visual_magic; if (!wtap_dump_file_write(wdh, magicp, magic_size, err)) |