summaryrefslogtreecommitdiffstats
path: root/hl/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-04-11 15:40:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-04-11 15:40:00 (GMT)
commitda4b69097756158fdbfcbf52b5b552e2034d263d (patch)
tree51d646d6a737c1e4216f04b9c9fa16a0afc49277 /hl/tools
parenta77bf61074122d4e6a100c09f23a684cd9655ff8 (diff)
parentccb4e9ed9a5e0af27db9f1504a628e35d7f4cf92 (diff)
downloadhdf5-da4b69097756158fdbfcbf52b5b552e2034d263d.zip
hdf5-da4b69097756158fdbfcbf52b5b552e2034d263d.tar.gz
hdf5-da4b69097756158fdbfcbf52b5b552e2034d263d.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_hyperslab_updates
Diffstat (limited to 'hl/tools')
-rw-r--r--hl/tools/h5watch/h5watch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c
index 97dca7a..f37b2b4 100644
--- a/hl/tools/h5watch/h5watch.c
+++ b/hl/tools/h5watch/h5watch.c
@@ -43,6 +43,7 @@ static int g_display_width = 80; /* output width in characters */
static hbool_t g_simple_output = FALSE; /* make output more machine-readable */
static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file if somehow file is unstable */
static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */
+static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */
static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank);
static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims,
@@ -337,7 +338,8 @@ monitor_dataset(hid_t fid, char *dsetname)
goto done;
}
- while(1) {
+ /* Loop until an error occurs or the user interrupts execution */
+ while(!g_user_interrupt) {
/* Refreshes the dataset */
if(H5Drefresh(did) < 0) {
@@ -798,9 +800,8 @@ parse_command_line(int argc, const char *argv[])
*/
static void catch_signal(int H5_ATTR_UNUSED signo)
{
- /* Exit from h5watch */
- leave(EXIT_SUCCESS);
-
+ /* Set the flag to get out of the main loop */
+ g_user_interrupt = TRUE;
} /* catch_signal() */