summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-11-01 20:33:46 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-11-01 20:33:46 (GMT)
commit0f87bc568ef4d25331ad1f2d9ec97c008dcf7f63 (patch)
treed55c10d2e0b213814f079f44fd4f6a9176d797e3 /src/H5FDdirect.c
parent73fc4188ac1f852823773db502d652179b970320 (diff)
parentb9d042d2d273cacff8ecfeecd5e1bd75a6da7f3b (diff)
downloadhdf5-0f87bc568ef4d25331ad1f2d9ec97c008dcf7f63.zip
hdf5-0f87bc568ef4d25331ad1f2d9ec97c008dcf7f63.tar.gz
hdf5-0f87bc568ef4d25331ad1f2d9ec97c008dcf7f63.tar.bz2
[svn-r23001] Description:
Bring r22659:22998 from trunk to branch. Tested on: Mac OSX/64 10.8.2 (amazon) w/debug, C++, FORTRAN and threadsafe (h5committest not required on this branch)
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 6ab472c..53dff6b 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -206,7 +206,7 @@ static const H5FD_class_t H5FD_direct_g = {
NULL, /*lock */
NULL, /*unlock */
NULL, /* coordinate */
- H5FD_FLMAP_SINGLE /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /*fl_map */
};
/* Declare a free list to manage the H5FD_direct_t struct */
@@ -534,7 +534,8 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* Get the driver specific information */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
- fa = H5P_get_driver_info(plist);
+ if(NULL == (fa = (H5FD_direct_fapl_t *)H5P_get_driver_info(plist)))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
file->fd = fd;
H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t);
@@ -563,9 +564,9 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
* is to handle correctly the case that the file is in a different file system
* than the one where the program is running.
*/
- buf1 = (int*)HDmalloc(sizeof(int));
- if (HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
+ buf1 = (int *)HDmalloc(sizeof(int));
+ if(HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
if(o_flags & O_CREAT) {
if(write(file->fd, (void*)buf1, sizeof(int))<0) {