aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/hcidump.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/hcidump.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/hcidump.c')
-rw-r--r--wiretap/hcidump.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/wiretap/hcidump.c b/wiretap/hcidump.c
index feae91057d..104d9f918c 100644
--- a/wiretap/hcidump.c
+++ b/wiretap/hcidump.c
@@ -49,7 +49,7 @@ static gboolean hcidump_read(wtap *wth, int *err, gchar **err_info,
bytes_read = file_read(&dh, DUMP_HDR_SIZE, wth->fh);
if (bytes_read != DUMP_HDR_SIZE) {
- *err = file_error(wth->fh);
+ *err = file_error(wth->fh, err_info);
if (*err == 0 && bytes_read != 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
@@ -73,7 +73,7 @@ static gboolean hcidump_read(wtap *wth, int *err, gchar **err_info,
bytes_read = file_read(buf, packet_size, wth->fh);
if (bytes_read != packet_size) {
- *err = file_error(wth->fh);
+ *err = file_error(wth->fh, err_info);
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
@@ -92,7 +92,7 @@ static gboolean hcidump_read(wtap *wth, int *err, gchar **err_info,
static gboolean hcidump_seek_read(wtap *wth, gint64 seek_off,
union wtap_pseudo_header *pseudo_header, guint8 *pd, int length,
- int *err, gchar **err_info _U_)
+ int *err, gchar **err_info)
{
struct dump_hdr dh;
int bytes_read;
@@ -102,7 +102,7 @@ static gboolean hcidump_seek_read(wtap *wth, gint64 seek_off,
bytes_read = file_read(&dh, DUMP_HDR_SIZE, wth->random_fh);
if (bytes_read != DUMP_HDR_SIZE) {
- *err = file_error(wth->random_fh);
+ *err = file_error(wth->random_fh, err_info);
if (*err == 0 && bytes_read != 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
@@ -110,7 +110,7 @@ static gboolean hcidump_seek_read(wtap *wth, gint64 seek_off,
bytes_read = file_read(pd, length, wth->random_fh);
if (bytes_read != length) {
- *err = file_error(wth->random_fh);
+ *err = file_error(wth->random_fh, err_info);
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
@@ -121,7 +121,7 @@ static gboolean hcidump_seek_read(wtap *wth, gint64 seek_off,
return TRUE;
}
-int hcidump_open(wtap *wth, int *err, gchar **err_info _U_)
+int hcidump_open(wtap *wth, int *err, gchar **err_info)
{
struct dump_hdr dh;
guint8 type;
@@ -129,7 +129,7 @@ int hcidump_open(wtap *wth, int *err, gchar **err_info _U_)
bytes_read = file_read(&dh, DUMP_HDR_SIZE, wth->fh);
if (bytes_read != DUMP_HDR_SIZE) {
- *err = file_error(wth->fh);
+ *err = file_error(wth->fh, err_info);
return (*err != 0) ? -1 : 0;
}
@@ -139,7 +139,7 @@ int hcidump_open(wtap *wth, int *err, gchar **err_info _U_)
bytes_read = file_read(&type, 1, wth->fh);
if (bytes_read != 1) {
- *err = file_error(wth->fh);
+ *err = file_error(wth->fh, err_info);
return (*err != 0) ? -1 : 0;
}