diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2007-11-05 22:13:43 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2007-11-05 22:13:43 (GMT) |
commit | f877f94c13de1df96866aa420496f2c0a9fab60d (patch) | |
tree | 79b382ff5bab009122eb3c4f4711fa92283caabd /src/H5O.c | |
parent | f0124823867f2ce6a807c396a71ef28156c53ed7 (diff) | |
download | hdf5-f877f94c13de1df96866aa420496f2c0a9fab60d.zip hdf5-f877f94c13de1df96866aa420496f2c0a9fab60d.tar.gz hdf5-f877f94c13de1df96866aa420496f2c0a9fab60d.tar.bz2 |
[svn-r14238] Bug fix: It's reported by the CGNS people. When an external link was opened twice, the library
had some trouble to close in the end. The problem came from the field "holding_file" of
H5O_loc_t. It's used to indicate special links like external links. The fix is to turn it off
whenever H5O_open is called. Later the caller function should turn it on when it needs to.
Tested on kagiso, linew, and smirom.
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1051,10 +1051,15 @@ done: * Programmer: Robb Matzke * Monday, January 5, 1998 * + * Modification: + * Raymond Lu + * 5 November 2007 + * Turn off the holding file variable if it's on. When it's + * needed, the caller will turn it on again. *------------------------------------------------------------------------- */ herr_t -H5O_open(const H5O_loc_t *loc) +H5O_open(H5O_loc_t *loc) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1069,8 +1074,11 @@ H5O_open(const H5O_loc_t *loc) HDfprintf(H5DEBUG(O), "> %a\n", loc->addr); #endif - /* Increment open-lock counters */ - loc->file->nopen_objs++; + /* Turn off the variable for holding file or increment open-lock counters */ + if(loc->holding_file) + loc->holding_file = FALSE; + else + loc->file->nopen_objs++; done: FUNC_LEAVE_NOAPI(ret_value) |