diff options
Diffstat (limited to 'test/swmr_reader.c')
-rw-r--r-- | test/swmr_reader.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 14e91ca..0ce368a 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -252,23 +252,23 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, /* Emit informational message */ if(verbose) - printf("Reading records\n"); + fprintf(stderr, "Reading records\n"); /* Get the starting time */ start_time = time(NULL); curr_time = start_time; - - /* Emit informational message */ - if(verbose) - fprintf(stderr, "Opening file: %s\n", filename); - - /* Open the file */ - if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0) - return -1; /* Loop over reading records until [at least] the correct # of seconds have passed */ while(curr_time < (time_t)(start_time + (time_t)nseconds)) { + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Opening file: %s\n", filename); + + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0) + return -1; + /* Check 'common' datasets, if any */ if(ncommon > 0) { /* Emit informational message */ @@ -299,6 +299,14 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, } /* end for */ } /* end if */ + /* Emit informational message */ + if(verbose) + fprintf(stderr, "Closing file\n"); + + /* Close the file */ + if(H5Fclose(fid) < 0) + return -1; + /* Sleep for the appropriate # of seconds */ sleep(poll_time); @@ -306,14 +314,6 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, curr_time = time(NULL); } /* end while */ - /* Emit informational message */ - if(verbose) - fprintf(stderr, "Closing file\n"); - - /* Close the file */ - if(H5Fclose(fid) < 0) - return -1; - /* Close the memory dataspace */ if(H5Sclose(mem_sid) < 0) return -1; |