From a566f617d8f712a8f4d1fe7b6d9b9f6ebe79ba11 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 7 Oct 2014 16:18:47 -0700 Subject: 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 --- wiretap/i4btrace.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'wiretap/i4btrace.c') diff --git a/wiretap/i4btrace.c b/wiretap/i4btrace.c index 4f7f241b42..6e9ef001dc 100644 --- a/wiretap/i4btrace.c +++ b/wiretap/i4btrace.c @@ -55,7 +55,6 @@ int i4btrace_open(wtap *wth, int *err, gchar **err_info) i4btrace_t *i4btrace; /* I4B trace files have no magic in the header... Sigh */ - errno = WTAP_ERR_CANT_READ; if (!wtap_read_bytes(wth->fh, &hdr, sizeof(hdr), err, err_info)) { if (*err != WTAP_ERR_SHORT_READ) return -1; @@ -142,7 +141,6 @@ i4b_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, i4b_trace_hdr_t hdr; guint32 length; - errno = WTAP_ERR_CANT_READ; if (!wtap_read_bytes_or_eof(fh, &hdr, sizeof hdr, err, err_info)) return FALSE; -- cgit v1.2.1