aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/tnef.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
commit6cbf6ce16c45c4855ebddd3516465885e3c476d5 (patch)
tree299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /wiretap/tnef.c
parent0315e063e4267b97fc7716301350af07dd0f2bea (diff)
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
Diffstat (limited to 'wiretap/tnef.c')
-rw-r--r--wiretap/tnef.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/tnef.c b/wiretap/tnef.c
index b0aebb0fe6..ce839fcc13 100644
--- a/wiretap/tnef.c
+++ b/wiretap/tnef.c
@@ -68,7 +68,7 @@ static gboolean tnef_read(wtap *wth, int *err, gchar **err_info, gint64 *data_of
buffer_assure_space(wth->frame_buffer, packet_size);
buf = buffer_start_ptr(wth->frame_buffer);
- wtap_file_read_expected_bytes(buf, packet_size, wth->fh, err);
+ wtap_file_read_expected_bytes(buf, packet_size, wth->fh, err, err_info);
wth->data_offset += packet_size;
@@ -88,7 +88,7 @@ static gboolean tnef_read(wtap *wth, int *err, gchar **err_info, gint64 *data_of
static gboolean tnef_seek_read(wtap *wth, gint64 seek_off,
union wtap_pseudo_header *pseudo_header _U_,
- guint8 *pd, int length, int *err, gchar **err_info _U_)
+ guint8 *pd, int length, int *err, gchar **err_info)
{
int packet_size = length;
@@ -101,19 +101,19 @@ static gboolean tnef_seek_read(wtap *wth, gint64 seek_off,
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
return FALSE;
- wtap_file_read_expected_bytes(pd, packet_size, wth->random_fh, err);
+ wtap_file_read_expected_bytes(pd, packet_size, wth->random_fh, err, err_info);
return TRUE;
}
-int tnef_open(wtap *wth, int *err, gchar **err_info _U_)
+int tnef_open(wtap *wth, int *err, gchar **err_info)
{
int bytes_read;
guint32 magic;
bytes_read = file_read(&magic, sizeof magic, wth->fh);
if (bytes_read != sizeof magic) {
- *err = file_error(wth->fh);
+ *err = file_error(wth->fh, err_info);
return (*err != 0) ? -1 : 0;
}