summaryrefslogtreecommitdiff
path: root/wiretap/peekclassic.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/peekclassic.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/peekclassic.c')
-rw-r--r--wiretap/peekclassic.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/wiretap/peekclassic.c b/wiretap/peekclassic.c
index cfd4c91bef..a1c4ade563 100644
--- a/wiretap/peekclassic.c
+++ b/wiretap/peekclassic.c
@@ -151,7 +151,7 @@ static gboolean peekclassic_seek_read_v56(wtap *wth, gint64 seek_off,
static gboolean peekclassic_read_packet_v56(wtap *wth, FILE_T fh,
struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info);
-int peekclassic_open(wtap *wth, int *err, gchar **err_info)
+wtap_open_return_val peekclassic_open(wtap *wth, int *err, gchar **err_info)
{
peekclassic_header_t ep_hdr;
struct timeval reference_time;
@@ -170,8 +170,8 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
if (!wtap_read_bytes(wth->fh, &ep_hdr.master,
(int)sizeof(ep_hdr.master), err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
- return -1;
- return 0;
+ return WTAP_OPEN_ERROR;
+ return WTAP_OPEN_NOT_MINE;
}
/*
@@ -200,15 +200,15 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
if (!wtap_read_bytes(wth->fh, &ep_hdr.secondary.v567,
(int)sizeof(ep_hdr.secondary.v567), err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
- return -1;
- return 0;
+ return WTAP_OPEN_ERROR;
+ return WTAP_OPEN_NOT_MINE;
}
if ((0 != ep_hdr.secondary.v567.reserved[0]) ||
(0 != ep_hdr.secondary.v567.reserved[1]) ||
(0 != ep_hdr.secondary.v567.reserved[2])) {
/* still unknown */
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
/*
@@ -245,7 +245,7 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
/*
* Assume this isn't a Peek classic file.
*/
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
break;
@@ -265,7 +265,7 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
/*
* Assume this isn't a Peek classic file.
*/
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
break;
@@ -273,7 +273,7 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
/*
* Assume this isn't a Peek classic file.
*/
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
@@ -309,7 +309,7 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
/*
* Assume this isn't a Peek classic file.
*/
- return 0;
+ return WTAP_OPEN_NOT_MINE;
}
/*
@@ -350,7 +350,7 @@ int peekclassic_open(wtap *wth, int *err, gchar **err_info)
wth->snapshot_length = 0; /* not available in header */
wth->file_tsprec = WTAP_TSPREC_USEC;
- return 1;
+ return WTAP_OPEN_MINE;
}
static gboolean peekclassic_read_v7(wtap *wth, int *err, gchar **err_info,