summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/h5repack_copy.c33
-rw-r--r--tools/h5repack/h5repack_refs.c24
2 files changed, 11 insertions, 46 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index f32d15d..c710bce 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -329,9 +329,18 @@ int do_copy_objects(hid_t fidin,
*/
case H5G_GROUP:
if (options->verbose)
- printf(FORMAT_OBJ,"group",travt->objs[i].name );
+ printf(FORMAT_OBJ,"group",travt->objs[i].name );
- if (options->grp_compact>0 || options->grp_indexed>0) {
+ /*-------------------------------------------------------------------------
+ * the root is a special case, we get an ID for the root group
+ * and copy its attributes using that ID
+ *-------------------------------------------------------------------------
+ */
+ if(HDstrcmp(travt->objs[i].name, "/") == 0) {
+ if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0)
+ goto error;
+ }
+ else if (options->grp_compact>0 || options->grp_indexed>0) {
/* Set up group creation property list */
if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
goto error;
@@ -780,26 +789,6 @@ int do_copy_objects(hid_t fidin,
} /* i */
- /*-------------------------------------------------------------------------
- * the root is a special case, we get an ID for the root group
- * and copy its attributes using that ID
- *-------------------------------------------------------------------------
- */
-
- if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0)
- goto error;
-
- if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0)
- goto error;
-
- if (copy_attr(grp_in,grp_out,options)<0)
- goto error;
-
- if (H5Gclose(grp_out)<0)
- goto error;
- if (H5Gclose(grp_in)<0)
- goto error;
-
return 0;
error:
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index e8799f8..8a549cd 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -397,30 +397,6 @@ int do_copy_refobjs(hid_t fidin,
}
}
-
-
- /*-------------------------------------------------------------------------
- * the root is a special case, we get an ID for the root group
- * and copy its attributes using that ID
- * it must be done last, because the attributes might contain references to
- * objects in the object list
- *-------------------------------------------------------------------------
- */
-
- if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0)
- goto error;
-
- if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0)
- goto error;
-
- if (copy_refs_attr(grp_in, grp_out, options, travt, fidout) < 0)
- goto error;
-
- if (H5Gclose(grp_out) < 0)
- goto error;
- if (H5Gclose(grp_in) < 0)
- goto error;
-
return 0;
error: