summaryrefslogtreecommitdiffstats
path: root/src/H5FDsplitter.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-08-03 16:11:27 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-08-03 16:11:27 (GMT)
commitbc1bed2c55981f1802f87f83054d375431a0088f (patch)
tree7f89238033aebca038770f6da775e13ec6902712 /src/H5FDsplitter.c
parent66ce984dee99b7b58ec4632fecad3b2b758d08d5 (diff)
downloadhdf5-bc1bed2c55981f1802f87f83054d375431a0088f.zip
hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.gz
hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.bz2
Squash merge of file locking fixes
Diffstat (limited to 'src/H5FDsplitter.c')
-rw-r--r--src/H5FDsplitter.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 4ed3c4a..eb30b1f 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -1221,16 +1221,12 @@ H5FD_splitter_lock(H5FD_t *_file, hbool_t rw)
HDassert(file->rw_file);
/* Place the lock on each file */
- if (H5FD_lock(file->rw_file, rw) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file")
- }
- if (file->wo_file != NULL) {
- if (H5FD_lock(file->wo_file, rw) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock",
- H5E_VFL, H5E_CANTLOCK, FAIL,
- "unable to lock W/O file")
- }
- }
+ if (H5FD_lock(file->rw_file, rw) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock R/W file")
+
+ if (file->wo_file != NULL)
+ if (H5FD_lock(file->wo_file, rw) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1260,15 +1256,12 @@ H5FD_splitter_unlock(H5FD_t *_file)
HDassert(file->rw_file);
/* Remove the lock on each file */
- if (H5FD_unlock(file->rw_file) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file")
- }
- if (file->wo_file != NULL) {
- if (H5FD_unlock(file->wo_file) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL,
- "unable to unlock W/O file")
- }
- }
+ if (H5FD_unlock(file->rw_file) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock R/W file")
+
+ if (file->wo_file != NULL)
+ if (H5FD_unlock(file->wo_file) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)