summaryrefslogtreecommitdiffstats
path: root/src/H5Ocache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-06-27 05:51:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-06-27 05:51:04 (GMT)
commit58a95d0d4a593157bb7e77f71347ee50783a11a0 (patch)
tree7a54c739616d9beabbbb8202ca0df568413ab040 /src/H5Ocache.c
parentdf8bd7ccd6cd8d50280a3a7d862064c6340e2169 (diff)
downloadhdf5-58a95d0d4a593157bb7e77f71347ee50783a11a0.zip
hdf5-58a95d0d4a593157bb7e77f71347ee50783a11a0.tar.gz
hdf5-58a95d0d4a593157bb7e77f71347ee50783a11a0.tar.bz2
[svn-r27292] Description:
Bring 'fail if unknown always' object header message flag from the avoid_truncate branch, strengthen error checking for unknown messages, and try to catch object header code configurations at compile time (instead of runtime). Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'src/H5Ocache.c')
-rw-r--r--src/H5Ocache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index db1bd1f..203d0fc 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -1130,7 +1130,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
id = *chunk_image++;
/* Check for unknown message ID getting encoded in file */
- if(id == H5O_UNKNOWN_ID)
+ if(id >= H5O_UNKNOWN_ID)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "'unknown' message ID encoded in file?!?")
/* Message size */
@@ -1218,9 +1218,10 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
/* Set message to "unknown" class */
oh->mesg[mesgno].type = H5O_msg_class_g[H5O_UNKNOWN_ID];
- /* Check for "fail if unknown" message flag */
- if((udata->file_intent & H5F_ACC_RDWR) &&
- (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE))
+ /* Check for "fail if unknown" message flags */
+ if(((udata->file_intent & H5F_ACC_RDWR) &&
+ (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE))
+ || (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS))
HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "unknown message with 'fail if unknown' flag found")
/* Check for "mark if unknown" message flag, etc. */
else if((flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN) &&