summaryrefslogtreecommitdiffstats
path: root/test/links.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-13 21:45:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-13 21:45:35 (GMT)
commitf494ab7674dc39225deb4a06ba211f82f3e9df5e (patch)
tree55d6b6ace03aa2063c0569466d9ef474fcf66487 /test/links.c
parent3f7dc01ccc7f9702c3a4080afe0c2ddebf34c032 (diff)
downloadhdf5-f494ab7674dc39225deb4a06ba211f82f3e9df5e.zip
hdf5-f494ab7674dc39225deb4a06ba211f82f3e9df5e.tar.gz
hdf5-f494ab7674dc39225deb4a06ba211f82f3e9df5e.tar.bz2
[svn-r12906] Description:
Straighten out some convoluted code when links were being deleted, which could cause the "delete" callback for user-defined links to not get called when the group they were in was deleted. Had to compromise on the "delete" callback though - only calls the callback with the ID for the file the link is in, instead of the group, since the group is being held open upstream in the calling sequence during a group deletion and this prevents a group and its ID from being created. (This could possibly be worked around, but would cause a fair bit of havoc in the code and I'm not entirely certain it's worth it...) Tested on: Linux/32 2.6 (chicago)
Diffstat (limited to 'test/links.c')
-rw-r--r--test/links.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/links.c b/test/links.c
index 7a3a4c0..0c1cae2 100644
--- a/test/links.c
+++ b/test/links.c
@@ -3679,7 +3679,7 @@ done:
/* UD_hard_delete decrements the object's reference count */
static herr_t
-UD_hard_delete(const char UNUSED * link_name, hid_t loc_group, void * udata, size_t udata_size)
+UD_hard_delete(const char UNUSED * link_name, hid_t file, void * udata, size_t udata_size)
{
haddr_t addr;
hid_t target_obj = -1;
@@ -3694,7 +3694,7 @@ UD_hard_delete(const char UNUSED * link_name, hid_t loc_group, void * udata, siz
addr = *((haddr_t *) udata);
/* Open the object this link points to */
- target_obj= H5Oopen_by_addr(loc_group, addr);
+ target_obj= H5Oopen_by_addr(file, addr);
if(target_obj < 0)
{
ret_value = -1;
@@ -4134,8 +4134,8 @@ UD_cb_move(const char * new_name, hid_t new_loc, void * udata, size_t udata_size
if(new_loc < 0) TEST_ERROR
if(udata_size > 0 && !udata) TEST_ERROR
- if(strcmp(new_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
- if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp(new_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
+ if(HDstrcmp(udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
return 0;
@@ -4146,14 +4146,14 @@ error:
/* Callback for when the link is deleted. Also called during move */
static herr_t
-UD_cb_delete(const char * link_name, hid_t loc_group, void * udata, size_t udata_size)
+UD_cb_delete(const char * link_name, hid_t file, void * udata, size_t udata_size)
{
if(!link_name) TEST_ERROR
- if(loc_group < 0) TEST_ERROR
+ if(file < 0) TEST_ERROR
if(udata_size > 0 && !udata) TEST_ERROR
- if(strcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
- if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
+ if(HDstrcmp(udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
return 0;
@@ -4528,7 +4528,7 @@ UD_cbsucc_move(const char UNUSED * new_name, hid_t UNUSED new_loc,
/* Callback for when the link is deleted. Also called during move */
static herr_t
-UD_cbsucc_delete(const char UNUSED * link_name, hid_t UNUSED loc_group,
+UD_cbsucc_delete(const char UNUSED * link_name, hid_t UNUSED file,
void UNUSED * udata, size_t UNUSED udata_size)
{
/* This callback will always succeed */
@@ -4537,7 +4537,7 @@ UD_cbsucc_delete(const char UNUSED * link_name, hid_t UNUSED loc_group,
/* Callback for when the link is deleted. Also called during move */
static herr_t
-UD_cbfail_delete(const char UNUSED * link_name, hid_t UNUSED loc_group,
+UD_cbfail_delete(const char UNUSED * link_name, hid_t UNUSED file,
void UNUSED * udata, size_t UNUSED udata_size)
{
/* This traversal function will always fail. */