summaryrefslogtreecommitdiffstats
path: root/src/H5FDcore.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2008-12-22 19:05:43 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2008-12-22 19:05:43 (GMT)
commit1448a3e8bbc720280a0c8c88aa928d3c87876b9e (patch)
treebcfa04ab2967bca97ec9ecd027bcb5f5f6d1804c /src/H5FDcore.c
parentc302b9b031b9a52bc7b3f4413adfa71f42e75d79 (diff)
downloadhdf5-1448a3e8bbc720280a0c8c88aa928d3c87876b9e.zip
hdf5-1448a3e8bbc720280a0c8c88aa928d3c87876b9e.tar.gz
hdf5-1448a3e8bbc720280a0c8c88aa928d3c87876b9e.tar.bz2
[svn-r16214] Added HDlseek to the H5FD_core_truncate function in H5FDcore.c to rewind the file pointer
to the beginning of the file. Otherwise, the file might be re-extended later on Open VMS. Also updated the return value for the HDlseek to be more appropriate. Tested 1.8 on Open VMS.
Diffstat (limited to 'src/H5FDcore.c')
-rw-r--r--src/H5FDcore.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 68a0655..cda7308 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -985,6 +985,13 @@ if(file->eof < new_eof)
/* Update backing store, if using it */
if(file->fd >= 0 && file->backing_store) {
+#ifdef H5_VMS
+ /* Reset seek offset to the beginning of the file, so that the file isn't
+ * re-extended later. This may happen on Open VMS. */
+ if(-1 == HDlseek(file->fd, 0, SEEK_SET))
+ HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
+#endif
+
if(-1 == HDftruncate(file->fd, (off_t)new_eof))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
} /* end if */