diff options
author | David Young <dyoung@hdfgroup.org> | 2020-04-24 15:18:15 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:37:19 (GMT) |
commit | c506a1f4358960f48d640e9f4375cebe2a69b934 (patch) | |
tree | e951e2f5a04ed030e9a4d6987cc12a863166bf5a /src | |
parent | b5481fac24819cf0848a1701d1472167c5018883 (diff) | |
download | hdf5-c506a1f4358960f48d640e9f4375cebe2a69b934.zip hdf5-c506a1f4358960f48d640e9f4375cebe2a69b934.tar.gz hdf5-c506a1f4358960f48d640e9f4375cebe2a69b934.tar.bz2 |
Fix `src/H5FDdirect.c:1346:5: error: ISO C90 forbids mixed declarations
and code [-Werror=declaration-after-statement]`.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDdirect.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index d045987..34c4346 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -1335,16 +1335,13 @@ static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw) { H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ - int lock; /* The type of lock */ + const int lock = rw ? LOCK_EX : LOCK_SH; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(file); - /* Determine the type of lock */ - int lock = rw ? LOCK_EX : LOCK_SH; - /* Place the lock with non-blocking */ if(HDflock(file->fd, lock | LOCK_NB) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file") |