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/camins.c | |
parent | 112c90a04b778958985b02b9663743cea1039f47 (diff) | |
download | wireshark-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/camins.c')
-rw-r--r-- | wiretap/camins.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/camins.c b/wiretap/camins.c index 82657f2e2b..660bcf4dc3 100644 --- a/wiretap/camins.c +++ b/wiretap/camins.c @@ -299,7 +299,7 @@ camins_seek_read(wtap *wth, gint64 seek_off, -int camins_open(wtap *wth, int *err, gchar **err_info _U_) +wtap_open_return_val camins_open(wtap *wth, int *err, gchar **err_info _U_) { guint8 found_start_blocks = 0; guint8 count = 0; @@ -311,7 +311,7 @@ int camins_open(wtap *wth, int *err, gchar **err_info _U_) if (!wtap_read_bytes(wth->fh, block, sizeof(block), err, err_info)) { if (*err == WTAP_ERR_SHORT_READ) break; - return -1; + return WTAP_OPEN_ERROR; } if (block[0]==0x00 && block[1] == 0xE1) @@ -321,11 +321,11 @@ int camins_open(wtap *wth, int *err, gchar **err_info _U_) } while (count<20); if (found_start_blocks < 2) - return 0; /* no CAM Inspector file */ + return WTAP_OPEN_NOT_MINE; /* no CAM Inspector file */ /* rewind the fh so we re-read from the beginning */ if (-1 == file_seek(wth->fh, 0, SEEK_SET, err)) - return -1; + return WTAP_OPEN_ERROR; wth->file_encap = WTAP_ENCAP_DVBCI; wth->snapshot_length = 0; @@ -338,7 +338,7 @@ int camins_open(wtap *wth, int *err, gchar **err_info _U_) wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_CAMINS; *err = 0; - return 1; + return WTAP_OPEN_MINE; } |