summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_remove_writer.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
commitc8f533cfc33ac743227cbed8eba361c715a2976f (patch)
treebcae5320f80bac774647cacbbd8493604f9384d2 /test/vfd_swmr_remove_writer.c
parentadcf8a315e82c0848d126e7e46b662930c081896 (diff)
downloadhdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.zip
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.gz
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.bz2
Merge all of my changes from merge-back-to-feature-vfd_swmr-attempt-1,
including the merge of `hdffv/hdf5/develop`, back to the branch that Vailin and I share. Now I need to put this branch on a fork with a less confusing name than vchoi_fork!
Diffstat (limited to 'test/vfd_swmr_remove_writer.c')
-rw-r--r--test/vfd_swmr_remove_writer.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/vfd_swmr_remove_writer.c b/test/vfd_swmr_remove_writer.c
index 3b79a58..3e5d474 100644
--- a/test/vfd_swmr_remove_writer.c
+++ b/test/vfd_swmr_remove_writer.c
@@ -71,7 +71,8 @@ static void usage(void);
*-------------------------------------------------------------------------
*/
static hid_t
-open_skeleton(const char *filename, unsigned verbose, unsigned old)
+open_skeleton(const char *filename, unsigned verbose,
+ unsigned old H5_ATTR_UNUSED)
{
hid_t fid = -1; /* File ID for new HDF5 file */
hid_t fapl = -1; /* File access property list */
@@ -119,7 +120,7 @@ open_skeleton(const char *filename, unsigned verbose, unsigned old)
goto error;
/* Allocate memory for the configuration structure */
- if((config = (H5F_vfd_swmr_config_t *)HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL)
goto error;
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
@@ -224,7 +225,7 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon
hsize_t remove_size; /* Size to reduce dataset dimension by */
/* Get a random dataset, according to the symbol distribution */
- symbol = choose_dataset();
+ symbol = choose_dataset(NULL, NULL);
/* Shrink the dataset's dataspace */
remove_size = (hsize_t)HDrandom() % MAX_REMOVE_SIZE + 1;
@@ -298,6 +299,7 @@ usage(void)
int main(int argc, const char *argv[])
{
+ sigset_t oldset;
hid_t fid; /* File ID for file opened */
long nshrinks = 0; /* # of times to shrink the dataset */
long flush_count = 1000; /* # of records to write between flushing file */
@@ -308,6 +310,8 @@ int main(int argc, const char *argv[])
unsigned u; /* Local index variable */
int temp;
+ block_signals(&oldset);
+
/* Parse command line options */
if(argc < 2)
usage();
@@ -422,6 +426,10 @@ int main(int argc, const char *argv[])
HDexit(1);
} /* end if */
+ await_signal(fid);
+
+ restore_signals(&oldset);
+
/* Emit informational message */
if(verbose)
HDfprintf(stderr, "WRITER: Closing objects\n");