summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-06-14 23:07:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-06-14 23:07:03 (GMT)
commitd3396a79532601bf22e385f94b12e55dfb2c3bd0 (patch)
treededf3566ea2ebf40c2d7475e8a50a3f2f0d57774 /tools/h5repack
parent7a9e13afdb134bafc070cf8bd2087a84fd0d2334 (diff)
downloadhdf5-d3396a79532601bf22e385f94b12e55dfb2c3bd0.zip
hdf5-d3396a79532601bf22e385f94b12e55dfb2c3bd0.tar.gz
hdf5-d3396a79532601bf22e385f94b12e55dfb2c3bd0.tar.bz2
[svn-r30075] Description:
Bring object/dataset/group/named datatype features from revise_chunks branch to trunk. Also CMake support for h5format_convert and a bunch of misc. cleanups. Tested on: MacOSX/64 10.11.5 (amazon) w/serial, parallel & production (h5committest forthcoming)
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/h5repack_main.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 7745860..e903435 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -264,14 +264,24 @@ int read_info(const char *filename, pack_opt_t *options) {
i = 0;
c = '0';
while (c != ' ') {
- fscanf(fp, "%c", &c);
+ if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ error_msg("fscanf error\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
+ } /* end if */
if (HDfeof(fp))
break;
}
c = '0';
/* go until end */
while (c != ' ') {
- fscanf(fp, "%c", &c);
+ if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ error_msg("fscanf error\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
+ } /* end if */
comp_info[i] = c;
i++;
if (HDfeof(fp))
@@ -282,10 +292,10 @@ int read_info(const char *filename, pack_opt_t *options) {
comp_info[i - 1] = '\0'; /*cut the last " */
if (h5repack_addfilter(comp_info, options) == -1) {
- error_msg("could not add compression option\n");
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
+ error_msg("could not add compression option\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
}
}
/*-------------------------------------------------------------------------
@@ -298,14 +308,24 @@ int read_info(const char *filename, pack_opt_t *options) {
i = 0;
c = '0';
while (c != ' ') {
- fscanf(fp, "%c", &c);
+ if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ error_msg("fscanf error\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
+ } /* end if */
if (HDfeof(fp))
break;
}
c = '0';
/* go until end */
while (c != ' ') {
- fscanf(fp, "%c", &c);
+ if(fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ error_msg("fscanf error\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
+ } /* end if */
comp_info[i] = c;
i++;
if (HDfeof(fp))
@@ -316,10 +336,10 @@ int read_info(const char *filename, pack_opt_t *options) {
comp_info[i - 1] = '\0'; /*cut the last " */
if (h5repack_addlayout(comp_info, options) == -1) {
- error_msg("could not add chunck option\n");
- h5tools_setstatus(EXIT_FAILURE);
- ret_value = EXIT_FAILURE;
- goto done;
+ error_msg("could not add chunck option\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ ret_value = EXIT_FAILURE;
+ goto done;
}
}
/*-------------------------------------------------------------------------