diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2010-07-07 20:06:20 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2010-07-07 20:06:20 (GMT) |
commit | 435f58c1b8bc3002cb23bfa935dc9c3cc5a8d68a (patch) | |
tree | 142060b1fc2822a7e9d15fba2726ddd1c5337f55 /tools/lib | |
parent | 68484a2099fd18e895bb7e097cf42127ca3550d2 (diff) | |
download | hdf5-435f58c1b8bc3002cb23bfa935dc9c3cc5a8d68a.zip hdf5-435f58c1b8bc3002cb23bfa935dc9c3cc5a8d68a.tar.gz hdf5-435f58c1b8bc3002cb23bfa935dc9c3cc5a8d68a.tar.bz2 |
[svn-r19053] Purpose:
Add --no-dangling-links option to h5ls.
Description:
Related to "Bug 1830 - Following an dangling external link in h5ls should set non-zero return code."
If --no-dangling-links option is specified and any dangling link is found, return exit code 1 (error).
Merged from hdf5 trunk r19051
Tested:
jam, amani, heiwa
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools_utils.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 0913501..b4c4cf5 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -638,7 +638,6 @@ tmpfile(void) * Patameters: * - [IN] fileid : link file id * - [IN] linkpath : link path - * - [OUT] h5li : link's info (H5L_info_t) * - [OUT] link_info: returning target object info (h5tool_link_info_t) * * Return: @@ -656,7 +655,7 @@ tmpfile(void) *-------------------------------------------------------------------------*/ int H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info) { - int Ret = -1; /* init to fail */ + int ret = -1; /* init to fail */ htri_t l_ret; H5O_info_t trg_oinfo; hid_t fapl; @@ -684,7 +683,7 @@ int H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info /* given path is hard link (object) */ if (link_info->linfo.type == H5L_TYPE_HARD) { - Ret = 2; + ret = 2; goto out; } @@ -721,7 +720,7 @@ int H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info /* detect dangling link */ if(l_ret == FALSE) { - Ret = 0; + ret = 0; goto out; } /* function failed */ @@ -750,7 +749,7 @@ int H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info link_info->trg_type = trg_oinfo.type; /* succeed */ - Ret = 1; + ret = 1; out: if (link_info->linfo.type == H5L_TYPE_EXTERNAL) { @@ -758,7 +757,7 @@ out: H5Pclose(lapl); } - return Ret; + return ret; } /*------------------------------------------------------------------------- |