summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.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/H5Tcommit.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/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 3e5e0eb..3866db1 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -485,12 +485,22 @@ H5T_open(H5G_loc_t *loc, hid_t dxpl_id)
if(NULL == (dt = H5FL_MALLOC(H5T_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype")
+#if defined(H5_USING_PURIFY) || !defined(NDEBUG)
+ /* Clear object location */
+ if(H5O_loc_reset(&(dt->oloc)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reset location")
+
+ /* Clear path name */
+ if(H5G_name_reset(&(dt->path)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reset path")
+#endif /* H5_USING_PURIFY */
+
/* Shallow copy (take ownership) of the object location object */
- if(H5O_loc_copy(&(dt->oloc), loc->oloc, H5O_COPY_SHALLOW) < 0)
+ if(H5O_loc_copy(&(dt->oloc), loc->oloc, H5_COPY_SHALLOW) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy object location")
/* Shallow copy (take ownership) of the group hier. path */
- if(H5G_name_copy(&(dt->path), loc->path, H5G_COPY_SHALLOW) < 0)
+ if(H5G_name_copy(&(dt->path), loc->path, H5_COPY_SHALLOW) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy path")
dt->shared = shared_fo;
@@ -560,11 +570,11 @@ H5T_open_oid(H5G_loc_t *loc, hid_t dxpl_id)
dt->shared->state = H5T_STATE_OPEN;
/* Shallow copy (take ownership) of the object location object */
- if(H5O_loc_copy(&(dt->oloc), loc->oloc, H5O_COPY_SHALLOW) < 0)
+ if(H5O_loc_copy(&(dt->oloc), loc->oloc, H5_COPY_SHALLOW) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy object location")
/* Shallow copy (take ownership) of the group hier. path */
- if(H5G_name_copy(&(dt->path), loc->path, H5G_COPY_SHALLOW) < 0)
+ if(H5G_name_copy(&(dt->path), loc->path, H5_COPY_SHALLOW) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy path")
/* Set return value */