From e92f3f858bf16a84c59aeb6692f5cab5e6b8e66f Mon Sep 17 00:00:00 2001 From: lrknox Date: Sun, 22 Oct 2017 22:35:15 -0500 Subject: Fix for HDFFFV-10308. Initialize hid_ts in function check_objects and check for id > -1 before calling close functions. --- tools/src/h5repack/h5repack.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 14b9461..22ca279 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -707,9 +707,9 @@ done: */ static int check_objects(const char* fname, pack_opt_t *options) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fid; - hid_t did; - hid_t sid; + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; unsigned int i; unsigned int uf; trav_table_t *travt = NULL; @@ -810,9 +810,12 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Fclose(fid); + if (sid > -1) + H5Sclose(sid); + if (did > -1) + H5Dclose(did); + if (fid > -1) + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); -- cgit v0.12 From b752960f56845f737d0e54cf257474d924fd2f0c Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 26 Oct 2017 16:36:21 -0500 Subject: Remove extra spaces and 1 "currently under development" to match hdf5_1_10 version. --- bin/h5vers | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/h5vers b/bin/h5vers index 5228903..a00beb7 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -198,7 +198,7 @@ my $H5_JAVA = $file; $H5_JAVA =~ s/[^\/]*$/..\/java\/src\/hdf\/hdf5lib\/H5.java/; die "unable to read file: $H5_JAVA\n" unless -r $file; my $TESTH5_JAVA = $file; -$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; +$TESTH5_JAVA =~ s/[^\/]*$/..\/java\/test\/TestH5.java/; die "unable to read file: $TESTH5_JAVA\n" unless -r $file; my $REPACK_LAYOUT_PLUGIN_VERSION = $file; $REPACK_LAYOUT_PLUGIN_VERSION =~ s/[^\/]*$/..\/tools\/test\/h5repack\/testfiles\/h5repack_layout.h5-plugin_version_test.ddl/; @@ -354,7 +354,7 @@ if ($HDF5CONFIGCMAKE) { my $sub_rel_ver_str = ( $newver[3] eq "" ? sprintf("\"%s\"", "") - : sprintf("\"%s\"", "-".$newver[3].", currently under development") + : sprintf("\"%s\"", "-".$newver[3]) ); my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]); @@ -377,7 +377,7 @@ if ($H5_JAVA) { my $version_string2 = sprintf("%d, %d, %d", @newver[0,1,2]); $data =~ s/\@version HDF5 .*
/\@version HDF5 $version_string1
/; - $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION[] = { $version_string2 };/; + $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION[] = { $version_string2 };/; write_file($H5_JAVA, $data); } @@ -395,7 +395,7 @@ if ($TESTH5_JAVA) { my $version_string2 = sprintf("int majnum = %d, minnum = %d, relnum = %d", @newver[0,1,2]); $data =~ s/ int libversion\[\] = { .* };/ int libversion\[\] = { $version_string1 };/; - $data =~ s/ int majnum = \d*, minnum = \d*, relnum = \d*;/ $version_string2;/; + $data =~ s/ int majnum = \d*, minnum = \d*, relnum = \d*;/ $version_string2;/; write_file($TESTH5_JAVA, $data); } @@ -410,7 +410,7 @@ if ($REPACK_LAYOUT_PLUGIN_VERSION) { write_file($REPACK_LAYOUT_PLUGIN_VERSION, $data); } -# helper function to read the file for updating c++/src/cpp_doc_config, +# helper function to read the file for updating c++/src/cpp_doc_config, # config/cmake/scripts/HDF5Config.cmake, and java files. # The version string in that file is not at the top, so the string replacement # is not for the first line, and reading/writing the entire file as one string -- cgit v0.12 From 6a52c26162f45e85b88aa6ddab5e5d861aaba7b8 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 26 Oct 2017 16:45:25 -0500 Subject: Revert "Fix for HDFFFV-10308. Initialize hid_ts in function check_objects and" This reverts commit e92f3f858bf16a84c59aeb6692f5cab5e6b8e66f. --- tools/src/h5repack/h5repack.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 22ca279..14b9461 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -707,9 +707,9 @@ done: */ static int check_objects(const char* fname, pack_opt_t *options) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fid = -1; - hid_t did = -1; - hid_t sid = -1; + hid_t fid; + hid_t did; + hid_t sid; unsigned int i; unsigned int uf; trav_table_t *travt = NULL; @@ -810,12 +810,9 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - if (sid > -1) - H5Sclose(sid); - if (did > -1) - H5Dclose(did); - if (fid > -1) - H5Fclose(fid); + H5Sclose(sid); + H5Dclose(did); + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); -- cgit v0.12