diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-10-14 19:35:08 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-10-14 19:35:08 (GMT) |
commit | cfb2a264f1a441c4267c9d6095a4f11744a602f2 (patch) | |
tree | 06613f81286b01a4d27ea420d432f6c5400b6e08 /src/H5F.c | |
parent | 6f9a11d046688e5b178fe96e70ea9b1569fc3856 (diff) | |
download | hdf5-cfb2a264f1a441c4267c9d6095a4f11744a602f2.zip hdf5-cfb2a264f1a441c4267c9d6095a4f11744a602f2.tar.gz hdf5-cfb2a264f1a441c4267c9d6095a4f11744a602f2.tar.bz2 |
[svn-r761] Changes since 19981013
----------------------
./src/H5.c
Fixed a signed vs. unsigned comparison.
./src/H5D.c
Setting a fill value of all zeros will cause the fill value to
be written to the dataset instead of relying on the low-level
file driver initializing unwritten areas with zero.
./src/H5D.c
./src/H5F.c
./src/H5Fprivate.h
./src/H5G.c
./src/H5Gpkg.h
./src/H5Gprivate.h
./src/H5O.c
./src/H5T.c
More file mounting stuff.
./src/H5I.c
Fixed a bug where trying to close an invalid object id caused
a core dump. For instance, H5Gclose(-1).
./MANIFEST
./test/Makefile.in
./test/mount.c [NEW]
Mounting tests.
./src/H5R.c
Fixed a couple (herr_t)NULL casts.
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -289,7 +289,7 @@ H5Fget_create_plist(hid_t file_id) H5TRACE1("i","i",file_id); /* check args */ - if (H5I_FILE != H5I_get_type(file_id) || NULL==(file=H5I_object(file_id))) { + if (H5I_FILE!=H5I_get_type(file_id) || NULL==(file=H5I_object(file_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); } @@ -1535,15 +1535,29 @@ H5F_flush(H5F_t *f, hbool_t invalidate) herr_t H5F_close(H5F_t *f) { + uintn i; + FUNC_ENTER(H5F_close, FAIL); /* + * Find the root of the virtual file. Then unmount and close each child + * before closing the current file. + */ + while (f->mtab.parent) f = f->mtab.parent; + for (i=0; i<f->mtab.nmounts; i++) { + H5G_close(f->mtab.child[i].group); + f->mtab.child[i].file->mtab.parent = NULL; + H5F_close(f->mtab.child[i].file); + } + f->mtab.nmounts = 0; + + /* * If object headers are still open then delay deletion of resources until * they have all been closed. Flush all caches and update the object * header anyway so that failing to close all objects isn't a major * problem. */ - if (f->nopen>0) { + if (f->nopen_objs>0) { if (H5F_flush(f, FALSE)<0) { HRETURN_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache"); @@ -1553,9 +1567,9 @@ H5F_close(H5F_t *f) fprintf(H5DEBUG(F), "H5F: H5F_close(%s): %u object header%s still " "open (file close will complete when %s closed)\n", f->name, - f->nopen, - 1 == f->nopen ? " is" : "s are", - 1 == f->nopen ? "that header is" : "those headers are"); + f->nopen_objs, + 1 == f->nopen_objs?" is":"s are", + 1 == f->nopen_objs?"that header is":"those headers are"); } #endif f->close_pending = TRUE; @@ -1942,6 +1956,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) if (0==cmp) { ent = H5G_entof(parent->mtab.child[md].file->shared->root_grp); *find = *ent; + parent = ent->file; } } while (!cmp); |