diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-09 16:44:15 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-09 23:45:30 +0000 |
commit | 45e462985db891248ffcb9db21e6b66733de0b84 (patch) | |
tree | 90d031f9769c07abaea83330a58dd9d3933eb7b1 /wiretap/commview.c | |
parent | 112c90a04b778958985b02b9663743cea1039f47 (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/commview.c')
-rw-r--r-- | wiretap/commview.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/commview.c b/wiretap/commview.c index 9840041d14..a504a383c4 100644 --- a/wiretap/commview.c +++ b/wiretap/commview.c @@ -88,14 +88,14 @@ static gboolean commview_read_header(commview_header_t *cv_hdr, FILE_T fh, static gboolean commview_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, const guint8 *pd, int *err); -int commview_open(wtap *wth, int *err, gchar **err_info) +wtap_open_return_val commview_open(wtap *wth, int *err, gchar **err_info) { commview_header_t cv_hdr; if(!commview_read_header(&cv_hdr, wth->fh, err, err_info)) { if (*err != 0 && *err != WTAP_ERR_SHORT_READ) - return -1; - return 0; + return WTAP_OPEN_ERROR; + return WTAP_OPEN_NOT_MINE; } /* If any of these fields do not match what we expect, bail out. */ @@ -111,11 +111,11 @@ int commview_open(wtap *wth, int *err, gchar **err_info) ((cv_hdr.flags & FLAGS_MEDIUM) != MEDIUM_ETHERNET && (cv_hdr.flags & FLAGS_MEDIUM) != MEDIUM_WIFI && (cv_hdr.flags & FLAGS_MEDIUM) != MEDIUM_TOKEN_RING)) - return 0; /* Not our kind of file */ + return WTAP_OPEN_NOT_MINE; /* Not our kind of file */ /* No file header. Reset the fh to 0 so we can read the first packet */ if (file_seek(wth->fh, 0, SEEK_SET, err) == -1) - return -1; + return WTAP_OPEN_ERROR; /* Set up the pointers to the handlers for this file type */ wth->subtype_read = commview_read; @@ -125,7 +125,7 @@ int commview_open(wtap *wth, int *err, gchar **err_info) wth->file_encap = WTAP_ENCAP_PER_PACKET; wth->file_tsprec = WTAP_TSPREC_USEC; - return 1; /* Our kind of file */ + return WTAP_OPEN_MINE; /* Our kind of file */ } static int |