diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2006-10-12 03:55:06 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2006-10-12 03:55:06 (GMT) |
commit | e065eee4a8932e6c09557bc539d6674138e9d7fe (patch) | |
tree | 794fd744c2d3b5efbc7523005c20ee9461f1cdff /test/stab.c | |
parent | 9b24333b1944e5b5c37aeff0b94fabfbacb15b20 (diff) | |
download | hdf5-e065eee4a8932e6c09557bc539d6674138e9d7fe.zip hdf5-e065eee4a8932e6c09557bc539d6674138e9d7fe.tar.gz hdf5-e065eee4a8932e6c09557bc539d6674138e9d7fe.tar.bz2 |
[svn-r12751] Purpose:
Bug fix (related to 544)
Description:
h5_get_file_size() was coded to return 0 if failed but
file size can be 0. Changed the failure return value to -1
which is allowed by the returned type of off_t which is a signed
type.
Also changed the checking code of the stat call to just == 0
since that is how it is defined.
Test:
Could test it in heping only. Both Sol and Copper failed to
compiled due to error in the Direct IO VFD code.
Diffstat (limited to 'test/stab.c')
-rw-r--r-- | test/stab.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/stab.c b/test/stab.c index f776b8c..74f3366 100644 --- a/test/stab.c +++ b/test/stab.c @@ -349,7 +349,7 @@ lifecycle(hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((empty_size = h5_get_file_size(filename)) == 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR /* Re-open file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR @@ -510,7 +510,7 @@ lifecycle(hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR + if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -574,7 +574,7 @@ long_compact(hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((empty_size = h5_get_file_size(filename)) == 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR /* Construct very long object name template */ if((objname = HDmalloc((size_t)(LONG_COMPACT_LENGTH + 1))) == NULL) TEST_ERROR @@ -654,7 +654,7 @@ long_compact(hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR + if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -832,7 +832,7 @@ no_compact(hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((empty_size = h5_get_file_size(filename)) == 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR /* Re-open file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR @@ -893,7 +893,7 @@ no_compact(hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR + if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR |