diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-14 13:39:36 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-14 13:39:36 (GMT) |
commit | 2f910f3fc770cfe9463bbdaa5a5c857e82acf324 (patch) | |
tree | 42cdaeded703853c3a94f0901d8ebdcf5fb96fcf /src/H5SM.c | |
parent | 8a6d7d14f6f947dd4eacdfff6c86a23d8cb7be95 (diff) | |
download | hdf5-2f910f3fc770cfe9463bbdaa5a5c857e82acf324.zip hdf5-2f910f3fc770cfe9463bbdaa5a5c857e82acf324.tar.gz hdf5-2f910f3fc770cfe9463bbdaa5a5c857e82acf324.tar.bz2 |
[svn-r15863] Description:
Bring r15861 back from trunk to 1.8 release branch.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5SM.c')
-rwxr-xr-x | src/H5SM.c | 34 |
1 files changed, 19 insertions, 15 deletions
@@ -1759,6 +1759,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) H5F_file_t *shared = f->shared; /* Shared file info (convenience variable) */ H5O_shmesg_table_t sohm_table; /* SOHM message from superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table */ + htri_t status; /* Status for message existing */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5SM_get_info, FAIL) @@ -1768,27 +1769,20 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HDassert(f && shared); HDassert(fc_plist); - /* Read in shared message information, if it exists */ - if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table, dxpl_id)) { - /* Reset error from "failed" message read */ - H5E_clear_stack(NULL); - - /* No SOHM info in file */ - shared->sohm_addr = HADDR_UNDEF; - shared->sohm_nindexes = 0; - shared->sohm_vers = 0; - - /* Shared object header messages are disabled */ - if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &shared->sohm_nindexes) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes") - } /* end if */ - else { + /* Check for the extension having a 'shared message info' message */ + if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to read object header") + if(status) { unsigned index_flags[H5O_SHMESG_MAX_NINDEXES]; /* Message flags for each index */ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Minimum message size for each index */ unsigned sohm_l2b; /* SOHM list-to-btree cutoff */ unsigned sohm_b2l; /* SOHM btree-to-list cutoff */ unsigned u; /* Local index variable */ + /* Retrieve the 'shared message info' structure */ + if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table, dxpl_id)) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "shared message info message not present") + /* Portably initialize the arrays */ HDmemset(index_flags, 0, sizeof(index_flags)); HDmemset(minsizes, 0, sizeof(minsizes)); @@ -1836,6 +1830,16 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set SOHM cutoff in property list") if(H5P_set(fc_plist, H5F_CRT_SHMSG_BTREE_MIN_NAME, &sohm_b2l) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set SOHM cutoff in property list") + } /* end if */ + else { + /* No SOHM info in file */ + shared->sohm_addr = HADDR_UNDEF; + shared->sohm_nindexes = 0; + shared->sohm_vers = 0; + + /* Shared object header messages are disabled */ + if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &shared->sohm_nindexes) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes") } /* end else */ done: |