summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2007-04-04 19:59:00 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2007-04-04 19:59:00 (GMT)
commit3431f74c438b25e7aeba9062ed1e948899457b46 (patch)
treeed7a1aa1282e74a0a4646762ce82f29b1749dbec /src/H5FD.c
parentea63d5fb19e8b260178e6f76e8ed0504ded148a3 (diff)
downloadhdf5-3431f74c438b25e7aeba9062ed1e948899457b46.zip
hdf5-3431f74c438b25e7aeba9062ed1e948899457b46.tar.gz
hdf5-3431f74c438b25e7aeba9062ed1e948899457b46.tar.bz2
[svn-r13588] A support of files bigger than 2GB for STDIO driver. Configure will
check if fseeko is available. Using it instead of fseek can support big files because the offset is of type off_t not long int. Also added the test for STDIO in big.c.
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index d1cb7c1..cb15467 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -1535,11 +1535,11 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
if(type != H5FD_MEM_DRAW) {
/* Handle metadata differently from "raw" data */
if((ret_value = H5FD_alloc_metadata(file, type, dxpl_id, size)) == HADDR_UNDEF)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for metadata")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate for metadata")
} else {
/* Allocate "raw" data */
if((ret_value = H5FD_alloc_raw(file, type, dxpl_id, size)) == HADDR_UNDEF)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for raw data")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate for raw data")
}
done:
@@ -1857,7 +1857,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
*/
if(size >= file->def_meta_block_size) {
/* Allocate more room for this new block the regular way */
- new_meta = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(new_meta = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata block")
/*
* Check if the new metadata is at the end of the current
@@ -1879,8 +1880,9 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate another metadata block */
- new_meta = H5FD_real_alloc(file, H5FD_MEM_DEFAULT, dxpl_id,
- file->def_meta_block_size);
+ if(HADDR_UNDEF==(new_meta = H5FD_real_alloc(file, H5FD_MEM_DEFAULT, dxpl_id,
+ file->def_meta_block_size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata block")
/*
* Check if the new metadata is at the end of the current
@@ -1916,7 +1918,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate data the regular way */
- ret_value = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(ret_value = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata block")
}
done:
@@ -1970,7 +1973,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
/* Check if the block asked for is too large for the "small data" block */
if(size >= file->def_sdata_block_size) {
/* Allocate more room for this new block the regular way */
- new_data = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(new_data = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data block")
/*
* Check if the new raw data is at the end of the current
@@ -1992,8 +1996,9 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate another "small data" block */
- new_data = H5FD_real_alloc(file, type, dxpl_id,
- file->def_sdata_block_size);
+ if(HADDR_UNDEF==(new_data = H5FD_real_alloc(file, type, dxpl_id,
+ file->def_sdata_block_size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data block")
/*
* Check if the new raw data is at the end of the current
@@ -2032,7 +2037,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate data the regular way */
- ret_value = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(ret_value = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data block")
}
done: