summaryrefslogtreecommitdiffstats
path: root/src/H5Ocache.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-01-20 17:17:05 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-01-20 17:17:05 (GMT)
commitaac2bb6182878e3591de390173e769bb761c83e2 (patch)
tree9e8d1da6fbb8016a4e01c2997673447fe8ca4157 /src/H5Ocache.c
parent1949c40bfddf4bea44345e0cd00baae94597f23a (diff)
downloadhdf5-aac2bb6182878e3591de390173e769bb761c83e2.zip
hdf5-aac2bb6182878e3591de390173e769bb761c83e2.tar.gz
hdf5-aac2bb6182878e3591de390173e769bb761c83e2.tar.bz2
[svn-r25984] change the message flag H5O_MSG_FLAG_FAIL_IF_UNKNOWN to
H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE. Will add a new H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS with the new avoid_truncate patch coming later. tested h5committest
Diffstat (limited to 'src/H5Ocache.c')
-rw-r--r--src/H5Ocache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 847bf71..b3dea03 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -1132,7 +1132,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image,
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unknown flag for message")
if((flags & H5O_MSG_FLAG_SHARED) && (flags & H5O_MSG_FLAG_DONTSHARE))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
- if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN))
+ if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && !(flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
@@ -1208,7 +1208,8 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image,
oh->mesg[mesgno].type = H5O_msg_class_g[H5O_UNKNOWN_ID];
/* Check for "fail if unknown" message flag */
- if(flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN)
+ if((udata->file_intent & H5F_ACC_RDWR) &&
+ (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE))
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) &&