summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-11-06 13:45:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-11-06 13:45:39 (GMT)
commit8ca8c23b5aab2b7b6ba8d0bcb196f64c2f253b6e (patch)
treeea5bd36a62e79d7fde953e15caa4a03581f76c68 /tools
parentdebbaac81db5258c30bc959fde286afd6e58cab1 (diff)
downloadhdf5-8ca8c23b5aab2b7b6ba8d0bcb196f64c2f253b6e.zip
hdf5-8ca8c23b5aab2b7b6ba8d0bcb196f64c2f253b6e.tar.gz
hdf5-8ca8c23b5aab2b7b6ba8d0bcb196f64c2f253b6e.tar.bz2
[svn-r7822] Purpose:
Bug fix & code cleanup Description: Propagate error value out of function, so that failures can be detected by testing scripts. Clean up a few compiler warnings while I'm here. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest
Diffstat (limited to 'tools')
-rw-r--r--tools/h5repack/h5repack_list.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/h5repack/h5repack_list.c b/tools/h5repack/h5repack_list.c
index 8358221..81b56ce 100644
--- a/tools/h5repack/h5repack_list.c
+++ b/tools/h5repack/h5repack_list.c
@@ -200,7 +200,10 @@ int copy_file(char* fnamein,
*-------------------------------------------------------------------------
*/
- do_copy_file(fidin,fidout,nobjects,info,options);
+ if(do_copy_file(fidin,fidout,nobjects,info,options)<0) {
+ printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein, fnameout);
+ return -1;
+ }
/*-------------------------------------------------------------------------
* free
@@ -361,7 +364,7 @@ int do_copy_file(hid_t fidin,
nelmts*=dims[j];
if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0)
goto error;
- if ((msize=H5Tget_size(mtype_id))<0)
+ if ((msize=H5Tget_size(mtype_id))==0)
goto error;
buf=(void *) HDmalloc((unsigned)(nelmts*msize));
if ( buf==NULL){
@@ -540,19 +543,20 @@ int copy_attr(hid_t loc_in,
int rank; /* rank of dataset */
hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */
char name[255];
- int n, i, j;
+ int n, j;
+ unsigned u;
if ((n = H5Aget_num_attrs(loc_in))<0)
goto error;
- for ( i = 0; i < n; i++)
+ for ( u = 0; u < (unsigned)n; u++)
{
/*-------------------------------------------------------------------------
* open
*-------------------------------------------------------------------------
*/
/* open attribute */
- if ((attr_id = H5Aopen_idx(loc_in, i))<0)
+ if ((attr_id = H5Aopen_idx(loc_in, u))<0)
goto error;
/* get name */
@@ -580,7 +584,7 @@ int copy_attr(hid_t loc_in,
nelmts*=dims[j];
if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0)
goto error;
- if ((msize=H5Tget_size(mtype_id))<0)
+ if ((msize=H5Tget_size(mtype_id))==0)
goto error;
buf=(void *) HDmalloc((unsigned)(nelmts*msize));
if ( buf==NULL){
@@ -616,7 +620,7 @@ int copy_attr(hid_t loc_in,
if (H5Aclose(attr_out)<0) goto error;
if (buf)
free(buf);
- } /* i */
+ } /* u */
return 0;