summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-12-26 05:28:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-12-26 05:28:18 (GMT)
commit83929ea716220890e41f923566aa5c89e8e735d3 (patch)
tree22193da0d9129fc7c06a57db35b2f4a57458cf50 /src/H5A.c
parentdb551ec15e771b4536c35cc6f3eabb7d28681510 (diff)
downloadhdf5-83929ea716220890e41f923566aa5c89e8e735d3.zip
hdf5-83929ea716220890e41f923566aa5c89e8e735d3.tar.gz
hdf5-83929ea716220890e41f923566aa5c89e8e735d3.tar.bz2
[svn-r11838] Purpose:
Bug fix Description: Retrieving an object's name could fail (in various ways) under certain circumstances (mostly having to do with mounted files). Solution: Re-write & simplify "get object name" code to fix error in a better way than adding yet another hack to the previous pile of hacks... :-) Platforms tested: FreeBSD 4.11 (sleipnir) h5committest
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 25d5368..e26e48b 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -256,11 +256,11 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
attr->initialized = TRUE; /*for now, set to false later*/
/* Copy the object header information */
- if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5O_COPY_DEEP) < 0)
+ if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry")
/* Deep copy of the group hierarchy path */
- if(H5G_name_copy(&(attr->path), loc->path, H5G_COPY_DEEP) < 0)
+ if(H5G_name_copy(&(attr->path), loc->path, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy path")
/* Compute the size of pieces on disk */
@@ -526,12 +526,22 @@ H5A_open(H5G_loc_t *loc, unsigned idx, hid_t dxpl_id)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from dataset header")
attr->initialized = TRUE;
+#if defined(H5_USING_PURIFY) || !defined(NDEBUG)
+ /* Clear object location */
+ if(H5O_loc_reset(&(attr->oloc)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset location")
+
+ /* Clear path name */
+ if(H5G_name_reset(&(attr->path)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset path")
+#endif /* H5_USING_PURIFY */
+
/* Deep copy of the symbol table entry */
- if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5O_COPY_DEEP) < 0)
+ if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry")
/* Deep copy of the group hier. path */
- if(H5G_name_copy(&(attr->path), loc->path, H5G_COPY_DEEP) < 0)
+ if(H5G_name_copy(&(attr->path), loc->path, H5_COPY_DEEP) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry")
/* Hold the symbol table entry (and file) open */