From 6cbf6ce16c45c4855ebddd3516465885e3c476d5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 21 Apr 2011 09:41:52 +0000 Subject: Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered by the gunzipping code. Have it also supply a err_info string, and report it. Have file_error() supply an err_info string. Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to suggest a decompression error - into the rawshark and tshark errors, along the lines of what other programs print. Fix a case in the Netscaler code where we weren't fetching the error code on a read failure. svn path=/trunk/; revision=36748 --- capture_info.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'capture_info.c') diff --git a/capture_info.c b/capture_info.c index 54f01a4a3e..7fe86bbf8d 100644 --- a/capture_info.c +++ b/capture_info.c @@ -185,6 +185,14 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, errmsg = "A full header couldn't be written to the file \"%s\"."; break; + case WTAP_ERR_DECOMPRESS: + g_snprintf(errmsg_errno, sizeof(errmsg_errno), + "The compressed file \"%%s\" appears to be damaged or corrupt.\n" + "(%s)", err_info); + g_free(err_info); + errmsg = errmsg_errno; + break; + default: g_snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" could not be %s: %s.", -- cgit v1.2.1