summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-04-11 23:56:52 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-04-11 23:56:52 (GMT)
commita040b40b5cc42a0547bf2c4a9a75f3365f15fd69 (patch)
tree922aa705fdb946bc325a89c684fb66975de4f440 /src/H5D.c
parent27e7bde1725d4e5ed25b199b5e0ec8f4f8bc2548 (diff)
downloadhdf5-a040b40b5cc42a0547bf2c4a9a75f3365f15fd69.zip
hdf5-a040b40b5cc42a0547bf2c4a9a75f3365f15fd69.tar.gz
hdf5-a040b40b5cc42a0547bf2c4a9a75f3365f15fd69.tar.bz2
[svn-r5172]
Purpose: Compatibility with v1.5 Description: Modified a little to match V1.5's fill value changes. Platforms tested: Linux 2.2
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/H5D.c b/src/H5D.c
index a389b59..764e135 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1431,12 +1431,16 @@ H5D_open_oid(H5G_entry_t *ent)
}
/* Get the external file list message, which might not exist */
- if (NULL==H5O_read (&(dataset->ent), H5O_EFL, 0,
+ /*if (NULL==H5O_read (&(dataset->ent), H5O_EFL, 0,
&(dataset->create_parms->efl)) &&
!H5F_addr_defined (dataset->layout.addr)) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, NULL,
"storage address is undefined an no external file list");
- }
+ }*/
+ /* A temporary solution for compatibility with v1.5. For new fill value
+ * design, data space may not allocated except in case of external storage.
+ */
+ H5O_read (&(dataset->ent), H5O_EFL, 0, &(dataset->create_parms->efl));
/*
* Make sure all storage is properly initialized for chunked datasets.
@@ -1614,6 +1618,11 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
HDmemset(&bkg_iter,0,sizeof(H5S_sel_iter_t));
HDmemset(&file_iter,0,sizeof(H5S_sel_iter_t));
+ /* Check if the dataset has space */
+ if(!H5F_addr_defined (dataset->layout.addr)
+ && (dataset->create_parms->efl.nused==0))
+ HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "no data to read");
+
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
@@ -2088,6 +2097,11 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
printf("%s: check 0.3, buf=%p\n", FUNC,buf);
#endif /* QAK */
+ /* Check if the dataset has space */
+ if(!H5F_addr_defined (dataset->layout.addr)
+ && (dataset->create_parms->efl.nused==0))
+ HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "no space to write");
+
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;