summaryrefslogtreecommitdiffstats
path: root/src/H5G.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-02-26 18:05:27 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-02-26 18:05:27 (GMT)
commitf82fc6b33dfd1f752183330e61807ab94ef2c6b7 (patch)
tree0e6f60c5435c8791ca4ecbb0549f72f7c6bb184b /src/H5G.c
parentad73f18f5e759c4bd3d12c331659a24b54d0c39a (diff)
downloadhdf5-f82fc6b33dfd1f752183330e61807ab94ef2c6b7.zip
hdf5-f82fc6b33dfd1f752183330e61807ab94ef2c6b7.tar.gz
hdf5-f82fc6b33dfd1f752183330e61807ab94ef2c6b7.tar.bz2
[svn-r299] Changes since 19980224
---------------------- ./html/Files.html Added a few details for some of the new H5Pset/get functions. ./src/H5F.c ./src/H5Fpublic.h Fixed automatic closing of files on exit(). Added public H5F_ACC_DEBUG. Using it to create or open a file turns on debugging for that file, which currently just prints cache statistics when the file is closed. ./src/H5G.c An error is returned if one tries to set the current working group to something other than a group. ./src/H5Gnode.c Fixed a symbol table bug. Under certain circumstances it was possible to enter a symbol in such a way that lookup of that symbol failed. A bug report was sent to hdf5dev. ./src/H5P.c ./src/H5Ppublic.h Added the H5Pget_...() functions for file drivers. The H5Pget_mpi() is a no-op that always fails.
Diffstat (limited to 'src/H5G.c')
-rw-r--r--src/H5G.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/H5G.c b/src/H5G.c
index fd6f130..e1212b0 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -834,11 +834,12 @@ H5G_create(H5F_t *f, const char *name, size_t size_hint)
*
*-------------------------------------------------------------------------
*/
-H5G_t *
+H5G_t *
H5G_open(H5F_t *f, const char *name)
{
- H5G_t *grp = NULL;
- H5G_t *ret_value = NULL;
+ H5G_t *grp = NULL;
+ H5G_t *ret_value = NULL;
+ H5O_stab_t mesg;
FUNC_ENTER(H5G_open, NULL);
@@ -846,7 +847,7 @@ H5G_open(H5F_t *f, const char *name)
assert(f);
assert(name && *name);
- /* Open the group */
+ /* Open the object, making sure it's a group */
grp = H5MM_xcalloc(1, sizeof(H5G_t));
if (H5G_find(f, name, NULL, &(grp->ent)) < 0) {
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found");
@@ -854,6 +855,10 @@ H5G_open(H5F_t *f, const char *name)
if (H5O_open(f, &(grp->ent)) < 0) {
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open group");
}
+ if (NULL==H5O_read (&(grp->ent), H5O_STAB, 0, &mesg)) {
+ H5O_close (&(grp->ent));
+ HGOTO_ERROR (H5E_SYM, H5E_CANTOPENOBJ, NULL, "not a group");
+ }
grp->nref = 1;
ret_value = grp;