summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-12-23 22:29:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-12-23 22:29:51 (GMT)
commitde5e1d93e44fdab49ab2d6b3bad4042219ad5236 (patch)
tree0aa77d26b2bcb26d986413080661e78e5c2ec5dc /src
parent26a82c35750b688cb9a5c21bc27e272416027622 (diff)
downloadhdf5-de5e1d93e44fdab49ab2d6b3bad4042219ad5236.zip
hdf5-de5e1d93e44fdab49ab2d6b3bad4042219ad5236.tar.gz
hdf5-de5e1d93e44fdab49ab2d6b3bad4042219ad5236.tar.bz2
[svn-r16219] Description:
Bring revisions 16206:16218 back from trunk Tested on: Mac OS X/32 10.5.6 (amazon)
Diffstat (limited to 'src')
-rw-r--r--src/H5FDcore.c7
-rw-r--r--src/H5FDsec2.c2
-rw-r--r--src/H5Znbit.c8
-rw-r--r--src/H5Zscaleoffset.c4
-rw-r--r--src/H5Zszip.c4
5 files changed, 18 insertions, 7 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 */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 093624b..b35ea7d 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -888,7 +888,7 @@ HDfprintf(stderr, "%s: file->eof = %a, file->eoa = %a\n", FUNC, file->eof, file-
#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(HDlseek(file->fd, (file_offset_t)0, SEEK_SET) < 0)
+ if(-1 == HDlseek(file->fd, (file_offset_t)0, SEEK_SET))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
#endif
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index fabc7f0..97a00f0 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -904,6 +904,9 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* decompress the buffer */
H5Z_nbit_decompress(outbuf, d_nelmts, *buf, cd_values);
+
+ *buf_size = size_out;
+ ret_value = size_out;
}
/* output; compress */
else {
@@ -917,6 +920,9 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* compress the buffer, size_out will be changed */
H5Z_nbit_compress(*buf, d_nelmts, outbuf, &size_out, cd_values);
+
+ *buf_size = nbytes;
+ ret_value = size_out;
}
/* free the input buffer */
@@ -925,8 +931,6 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* set return values */
*buf = outbuf;
outbuf = NULL;
- *buf_size = size_out;
- ret_value = size_out;
done:
if(outbuf)
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 84d404e..28d8f93 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -1139,8 +1139,8 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu
HDmemcpy(outbuf+buf_offset, *buf, nbytes);
*buf = outbuf;
outbuf = NULL;
- *buf_size = buf_offset+nbytes;
- ret_value = *buf_size;
+ *buf_size = size_out;
+ ret_value = buf_offset+nbytes;
goto done;
}
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 9201a80..b40c028 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -333,7 +333,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
*buf = outbuf;
outbuf = NULL;
*buf_size = nalloc;
- ret_value = nalloc;
+ ret_value = size_out;
}
/* Output; compress */
else {
@@ -359,7 +359,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Set return values */
*buf = outbuf;
outbuf = NULL;
- *buf_size = size_out+4;
+ *buf_size = nbytes+4;
ret_value = size_out+4;
}