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/mpeg.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/mpeg.c')
-rw-r--r-- | wiretap/mpeg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/mpeg.c b/wiretap/mpeg.c index 00ff23e9bb..304d1d73cc 100644 --- a/wiretap/mpeg.c +++ b/wiretap/mpeg.c @@ -231,7 +231,7 @@ struct _mpeg_magic { { 0, NULL } }; -int +wtap_open_return_val mpeg_open(wtap *wth, int *err, gchar **err_info) { char magic_buf[16]; @@ -241,8 +241,8 @@ mpeg_open(wtap *wth, int *err, gchar **err_info) if (!wtap_read_bytes(wth->fh, magic_buf, sizeof magic_buf, err, err_info)) { if (*err != WTAP_ERR_SHORT_READ) - return -1; - return 0; + return WTAP_OPEN_ERROR; + return WTAP_OPEN_NOT_MINE; } for (m=magic; m->match; m++) { @@ -250,12 +250,12 @@ mpeg_open(wtap *wth, int *err, gchar **err_info) goto good_magic; } - return 0; + return WTAP_OPEN_NOT_MINE; good_magic: /* This appears to be a file with MPEG data. */ if (file_seek(wth->fh, 0, SEEK_SET, err) == -1) - return -1; + return WTAP_OPEN_ERROR; wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_MPEG; wth->file_encap = WTAP_ENCAP_MPEG; @@ -270,5 +270,5 @@ good_magic: mpeg->now.nsecs = 0; mpeg->t0 = mpeg->now.secs; - return 1; + return WTAP_OPEN_MINE; } |