summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-04-08 22:16:45 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-04-08 22:16:45 (GMT)
commitef77500b284962ce87126ed86186019431bcf119 (patch)
tree8d6339aa3d36938cc8205ad71e2426899f1f72f7 /src/H5F.c
parent6f925167762871f0f1a416afdac25b5f1341aef4 (diff)
downloadhdf5-ef77500b284962ce87126ed86186019431bcf119.zip
hdf5-ef77500b284962ce87126ed86186019431bcf119.tar.gz
hdf5-ef77500b284962ce87126ed86186019431bcf119.tar.bz2
[svn-r16712] Purpose: Fix bug 1423
Description: Versions of the library between 1.3.0 and 1.6.3 have a bug which prevents them from opening any file that does not have the root group's symbol table information cached in the root group's entry in the superblock. Prior to 1.8 this was not an issue as this information was always cached. However, 1.8.0 stopped writing this information (which is not required by the file format specification), and these older versions can therefore not read files created or last written by versions 1.8.0 to 1.8.2. This fix modifies the library to once again add this information to the superblock (when using the old file format). Tested: jam, linew, smirom (h5committest)
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/H5F.c b/src/H5F.c
index e7b4cd3..eebbc4f 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -893,6 +893,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
f->shared->driver_addr = HADDR_UNDEF;
f->shared->accum.loc = HADDR_UNDEF;
f->shared->lf = lf;
+ f->shared->root_addr = HADDR_UNDEF;
/*
* Copy the file creation and file access property lists into the
@@ -1369,7 +1370,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
/* (This must be after the space for the superblock is allocated in
* the file, since the superblock must be at offset 0)
*/
- if(H5G_mkroot(file, dxpl_id, NULL) < 0)
+ if(H5G_mkroot(file, dxpl_id, TRUE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group")
/* Write the superblock to the file */
@@ -1379,21 +1380,12 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
if(H5F_super_write(file, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to write file superblock")
} else if (1 == shared->nrefs) {
- H5G_loc_t root_loc; /*root location */
- H5O_loc_t root_oloc; /*root object location */
- H5G_name_t root_path; /*root group hier. path */
-
- /* Set up root location to fill in */
- root_loc.oloc = &root_oloc;
- root_loc.path = &root_path;
- H5G_loc_reset(&root_loc);
-
/* Read the superblock if it hasn't been read before. */
- if(H5F_super_read(file, dxpl_id, &root_loc) < 0)
+ if(H5F_super_read(file, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
/* Open the root group */
- if(H5G_mkroot(file, dxpl_id, &root_loc) < 0)
+ if(H5G_mkroot(file, dxpl_id, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group")
} /* end if */