summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2003-04-21 22:26:32 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2003-04-21 22:26:32 (GMT)
commit8203a4ce4ef7b980e4b4f5cfc8589a44827066c8 (patch)
tree30817a5e0745c1cfc33b249d3fa83207a2e4a960 /src
parent535172c8fb0ba9078cdaedf26cd36009864e0d99 (diff)
downloadhdf5-8203a4ce4ef7b980e4b4f5cfc8589a44827066c8.zip
hdf5-8203a4ce4ef7b980e4b4f5cfc8589a44827066c8.tar.gz
hdf5-8203a4ce4ef7b980e4b4f5cfc8589a44827066c8.tar.bz2
[svn-r6721] Purpose:
bug fix Description: in the close strong case in H5F_close there was a do..while loop that executed when nfiles==0, calling malloc(0) this was causing a failure in the close call in Code Warrior, that returns 0 in the call pt=malloc(0) Solution: replaced with a while loop (checks the condition before executing) Platforms tested: code warrior, linux Misc. update:
Diffstat (limited to 'src')
-rw-r--r--src/H5F.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/H5F.c b/src/H5F.c
index c753180..bfd0586 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2829,6 +2829,9 @@ done:
* Modified H5F_flush call to take one flag instead of
* several Boolean flags.
*
+ * Pedro Vicente, 2003-04-21
+ * Changed do.while loop to while in the H5F_CLOSE_STRONG case.
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2953,7 +2956,8 @@ H5F_close(H5F_t *f)
case H5F_CLOSE_STRONG:
/* Forcefully close all opened objects in file */
- do {
+ while(f->nopen_objs > 0)
+ {
/* Allocate space for the IDs of objects still currently open */
if((oid_list = H5MM_malloc(f->nopen_objs*sizeof(hid_t)))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
@@ -2970,7 +2974,7 @@ H5F_close(H5F_t *f)
/* Free the ID list */
if(oid_list != NULL)
H5MM_xfree(oid_list);
- } while(f->nopen_objs > 0);
+ }
/* Indicate that the file will be closing */
closing=1;