summaryrefslogtreecommitdiff
path: root/wiretap/netmon.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-07 16:18:47 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-07 23:19:56 +0000
commita566f617d8f712a8f4d1fe7b6d9b9f6ebe79ba11 (patch)
tree1730a9b5c9cc7704273e4104a426e6987f9ef9b6 /wiretap/netmon.c
parent5e0e4fa9e4de39f9402e6472e6b25439f8464c24 (diff)
downloadwireshark-a566f617d8f712a8f4d1fe7b6d9b9f6ebe79ba11.tar.gz
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/netmon.c')
-rw-r--r--wiretap/netmon.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index 65da2d8805..684509aeb6 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -203,7 +203,6 @@ int netmon_open(wtap *wth, int *err, gchar **err_info)
/* Read in the string that should be at the start of a Network
* Monitor file */
- errno = WTAP_ERR_CANT_READ;
if (!wtap_read_bytes(wth->fh, magic, MAGIC_SIZE, err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
return -1;
@@ -216,7 +215,6 @@ int netmon_open(wtap *wth, int *err, gchar **err_info)
}
/* Read the rest of the header. */
- errno = WTAP_ERR_CANT_READ;
if (!wtap_read_bytes(wth->fh, &hdr, sizeof hdr, err, err_info))
return -1;
@@ -358,7 +356,6 @@ int netmon_open(wtap *wth, int *err, gchar **err_info)
*err = ENOMEM; /* we assume we're out of memory */
return -1;
}
- errno = WTAP_ERR_CANT_READ;
if (!wtap_read_bytes(wth->fh, frame_table, frame_table_length,
err, err_info)) {
g_free(frame_table);
@@ -489,7 +486,6 @@ netmon_process_record(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
hdr_size = sizeof (struct netmonrec_2_x_hdr);
break;
}
- errno = WTAP_ERR_CANT_READ;
if (!wtap_read_bytes_or_eof(fh, &hdr, hdr_size, err, err_info))
return FAILURE;
@@ -660,7 +656,6 @@ netmon_process_record(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
}
}
- errno = WTAP_ERR_CANT_READ;
if (!wtap_read_bytes(fh, &trlr, trlr_size, err, err_info))
return FAILURE;
@@ -876,7 +871,6 @@ netmon_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
struct netmon_atm_hdr atm_phdr;
guint16 vpi, vci;
- errno = WTAP_ERR_CANT_READ;
if (!wtap_read_bytes(fh, &atm_phdr, sizeof (struct netmon_atm_hdr),
err, err_info))
return FALSE;