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/i4btrace.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/i4btrace.c')
-rw-r--r-- | wiretap/i4btrace.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/i4btrace.c b/wiretap/i4btrace.c index 6e9ef001dc..8920f10c29 100644 --- a/wiretap/i4btrace.c +++ b/wiretap/i4btrace.c @@ -48,7 +48,7 @@ static int i4b_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, (unsigned int)hdr.unit > 4 || (unsigned int)hdr.type > 4 || \ (unsigned int)hdr.dir > 2 || (unsigned int)hdr.trunc > 2048)) -int i4btrace_open(wtap *wth, int *err, gchar **err_info) +wtap_open_return_val i4btrace_open(wtap *wth, int *err, gchar **err_info) { i4b_trace_hdr_t hdr; gboolean byte_swapped = FALSE; @@ -57,8 +57,8 @@ int i4btrace_open(wtap *wth, int *err, gchar **err_info) /* I4B trace files have no magic in the header... Sigh */ if (!wtap_read_bytes(wth->fh, &hdr, sizeof(hdr), err, err_info)) { if (*err != WTAP_ERR_SHORT_READ) - return -1; - return 0; + return WTAP_OPEN_ERROR; + return WTAP_OPEN_NOT_MINE; } /* Silly heuristic... */ @@ -75,7 +75,7 @@ int i4btrace_open(wtap *wth, int *err, gchar **err_info) /* * It doesn't look valid in either byte order. */ - return 0; + return WTAP_OPEN_NOT_MINE; } /* @@ -86,7 +86,7 @@ int i4btrace_open(wtap *wth, int *err, gchar **err_info) } if (file_seek(wth->fh, 0, SEEK_SET, err) == -1) - return -1; + return WTAP_OPEN_ERROR; /* Get capture start time */ @@ -102,7 +102,7 @@ int i4btrace_open(wtap *wth, int *err, gchar **err_info) wth->file_encap = WTAP_ENCAP_ISDN; wth->file_tsprec = WTAP_TSPREC_USEC; - return 1; + return WTAP_OPEN_MINE; } /* Read the next packet */ |