diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-07 16:18:47 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-07 23:19:56 +0000 |
commit | a566f617d8f712a8f4d1fe7b6d9b9f6ebe79ba11 (patch) | |
tree | 1730a9b5c9cc7704273e4104a426e6987f9ef9b6 /wiretap/visual.c | |
parent | 5e0e4fa9e4de39f9402e6472e6b25439f8464c24 (diff) |
No need for WTAP_ERR_CANT_READ.
Unlike the standard I/O routines, the code we introduced that supports
fast random seeking on gzipped files will always supply some specific
error code for read errors, so we don't need WTAP_ERR_CANT_READ.
Add WTAP_ERR_CANT_WRITE for writing, as we're still using the standard
I/O routines for that. Set errno to WTAP_ERR_CANT_WRITE before calling
fwrite() in wtap_dump_file_write(), so that it's used if fwrite() fails
without setting errno.
Change-Id: I6bf066a6838284a532737aa65fd0c9bb3639ad63
Reviewed-on: https://code.wireshark.org/review/4540
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/visual.c')
-rw-r--r-- | wiretap/visual.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c index 0aedeb3a73..d781e3651a 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -179,7 +179,6 @@ int visual_open(wtap *wth, int *err, gchar **err_info) int encap; /* Check the magic string at the start of the file */ - errno = WTAP_ERR_CANT_READ; if (!wtap_read_bytes(wth->fh, magic, sizeof magic, err, err_info)) { if (*err != WTAP_ERR_SHORT_READ) @@ -192,7 +191,6 @@ int visual_open(wtap *wth, int *err, gchar **err_info) } /* Read the rest of the file header. */ - errno = WTAP_ERR_CANT_READ; if (!wtap_read_bytes(wth->fh, &vfile_hdr, sizeof vfile_hdr, err, err_info)) { return -1; @@ -327,7 +325,6 @@ visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, guint8 *pd; /* Read the packet header. */ - errno = WTAP_ERR_CANT_READ; if (!wtap_read_bytes_or_eof(fh, &vpkt_hdr, (unsigned int)sizeof vpkt_hdr, err, err_info)) { return FALSE; @@ -445,7 +442,6 @@ visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, ATM packets have an additional packet header; read and process it. */ - errno = WTAP_ERR_CANT_READ; if (!wtap_read_bytes(fh, &vatm_hdr, (unsigned int)sizeof vatm_hdr, err, err_info)) { return FALSE; |