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/ascendtext.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/ascendtext.c')
-rw-r--r-- | wiretap/ascendtext.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/ascendtext.c b/wiretap/ascendtext.c index 008afd678f..9bd05f7527 100644 --- a/wiretap/ascendtext.c +++ b/wiretap/ascendtext.c @@ -156,7 +156,7 @@ found: return packet_off; } -int ascend_open(wtap *wth, int *err, gchar **err_info) +wtap_open_return_val ascend_open(wtap *wth, int *err, gchar **err_info) { gint64 offset; ws_statb64 statbuf; @@ -170,14 +170,14 @@ int ascend_open(wtap *wth, int *err, gchar **err_info) offset = ascend_seek(wth, err, err_info); if (offset == -1) { if (*err != 0 && *err != WTAP_ERR_SHORT_READ) - return -1; - return 0; + return WTAP_OPEN_ERROR; + return WTAP_OPEN_NOT_MINE; } /* Do a trial parse of the first packet just found to see if we might really have an Ascend file */ init_parse_ascend(); if (!check_ascend(wth->fh, &wth->phdr)) { - return 0; + return WTAP_OPEN_NOT_MINE; } wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_ASCEND; @@ -213,7 +213,7 @@ int ascend_open(wtap *wth, int *err, gchar **err_info) offset that we can apply to each packet. */ if (wtap_fstat(wth, &statbuf, err) == -1) { - return -1; + return WTAP_OPEN_ERROR; } ascend->inittime = statbuf.st_ctime; ascend->adjusted = FALSE; @@ -221,7 +221,7 @@ int ascend_open(wtap *wth, int *err, gchar **err_info) init_parse_ascend(); - return 1; + return WTAP_OPEN_MINE; } /* Read the next packet; called from wtap_read(). */ |