summaryrefslogtreecommitdiff
path: root/wiretap/iseries.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-09 16:44:15 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-09 23:45:30 +0000
commit45e462985db891248ffcb9db21e6b66733de0b84 (patch)
tree90d031f9769c07abaea83330a58dd9d3933eb7b1 /wiretap/iseries.c
parent112c90a04b778958985b02b9663743cea1039f47 (diff)
downloadwireshark-45e462985db891248ffcb9db21e6b66733de0b84.tar.gz
Use an enum for the open-routine return value, as per Evan Huus's suggestion.
Clean up some things we ran across while making those changes. Change-Id: Ic0d8943d36e6e120d7af0a6148fad98015d1e83e Reviewed-on: https://code.wireshark.org/review/4581 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/iseries.c')
-rw-r--r--wiretap/iseries.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/wiretap/iseries.c b/wiretap/iseries.c
index 50141f9ab6..e4d306eb93 100644
--- a/wiretap/iseries.c
+++ b/wiretap/iseries.c
@@ -194,7 +194,7 @@ static int iseries_UNICODE_to_ASCII (guint8 * buf, guint bytes);
static gboolean iseries_parse_hex_string (const char * ascii, guint8 * buf,
size_t len);
-int
+wtap_open_return_val
iseries_open (wtap * wth, int *err, gchar ** err_info)
{
gint offset;
@@ -212,8 +212,8 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
if (!wtap_read_bytes (wth->fh, &magic, sizeof magic, err, err_info))
{
if (*err != WTAP_ERR_SHORT_READ)
- return -1;
- return 0;
+ return WTAP_OPEN_ERROR;
+ return WTAP_OPEN_NOT_MINE;
}
/*
@@ -225,7 +225,7 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
if (memcmp (magic + offset, unicodemagic, sizeof unicodemagic) == 0) {
if (file_seek (wth->fh, 0, SEEK_SET, err) == -1)
{
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
/*
* Do some basic sanity checking to ensure we can handle the
@@ -234,9 +234,9 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
if (!iseries_check_file_type (wth, err, err_info, ISERIES_FORMAT_UNICODE))
{
if (*err == 0)
- return 0;
+ return WTAP_OPEN_NOT_MINE;
else
- return -1;
+ return WTAP_OPEN_ERROR;
}
wth->file_encap = WTAP_ENCAP_ETHERNET;
@@ -248,9 +248,9 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
if (file_seek (wth->fh, 0, SEEK_SET, err) == -1)
{
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
- return 1;
+ return WTAP_OPEN_MINE;
}
offset += 1;
}
@@ -265,7 +265,7 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
{
if (file_seek (wth->fh, 0, SEEK_SET, err) == -1)
{
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
/*
* Do some basic sanity checking to ensure we can handle the
@@ -274,9 +274,9 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
if (!iseries_check_file_type (wth, err, err_info, ISERIES_FORMAT_ASCII))
{
if (*err == 0)
- return 0;
+ return WTAP_OPEN_NOT_MINE;
else
- return -1;
+ return WTAP_OPEN_ERROR;
}
wth->file_encap = WTAP_ENCAP_ETHERNET;
@@ -288,15 +288,15 @@ iseries_open (wtap * wth, int *err, gchar ** err_info)
if (file_seek (wth->fh, 0, SEEK_SET, err) == -1)
{
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
- return 1;
+ return WTAP_OPEN_MINE;
}
offset += 1;
}
/* Neither ASCII or UNICODE so not supported */
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
/*