aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/aethra.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/aethra.c
parent112c90a04b778958985b02b9663743cea1039f47 (diff)
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/aethra.c')
-rw-r--r--wiretap/aethra.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/aethra.c b/wiretap/aethra.c
index 331c6fcfdd..09e4b90025 100644
--- a/wiretap/aethra.c
+++ b/wiretap/aethra.c
@@ -119,7 +119,7 @@ static gboolean aethra_seek_read(wtap *wth, gint64 seek_off,
static gboolean aethra_read_rec_header(wtap *wth, FILE_T fh, struct aethrarec_hdr *hdr,
struct wtap_pkthdr *phdr, int *err, gchar **err_info);
-int aethra_open(wtap *wth, int *err, gchar **err_info)
+wtap_open_return_val aethra_open(wtap *wth, int *err, gchar **err_info)
{
struct aethra_hdr hdr;
struct tm tm;
@@ -129,17 +129,17 @@ int aethra_open(wtap *wth, int *err, gchar **err_info)
if (!wtap_read_bytes(wth->fh, hdr.magic, sizeof hdr.magic, err,
err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
- return -1;
- return 0;
+ return WTAP_OPEN_ERROR;
+ return WTAP_OPEN_NOT_MINE;
}
if (memcmp(hdr.magic, aethra_magic, sizeof aethra_magic) != 0)
- return 0;
+ return WTAP_OPEN_NOT_MINE;
/* Read the rest of the header. */
if (!wtap_read_bytes(wth->fh, (char *)&hdr + sizeof hdr.magic,
sizeof hdr - sizeof hdr.magic, err, err_info))
- return -1;
+ return WTAP_OPEN_ERROR;
wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_AETHRA;
aethra = (aethra_t *)g_malloc(sizeof(aethra_t));
wth->priv = (void *)aethra;
@@ -165,7 +165,7 @@ int aethra_open(wtap *wth, int *err, gchar **err_info)
wth->file_encap = WTAP_ENCAP_ISDN;
wth->snapshot_length = 0; /* not available in header */
wth->file_tsprec = WTAP_TSPREC_MSEC;
- return 1;
+ return WTAP_OPEN_MINE;
}
#if 0