diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2006-11-22 07:21:48 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2006-11-22 07:21:48 (GMT) |
commit | 2181e7cb3cb5be0b9b3c1c0ccd8cc7617e7b310a (patch) | |
tree | e9397ff700e42d1e3df216e7a591fe5f5747ab4f /test/tattr.c | |
parent | d4600f0fbdb9c70d3bca3e35ef2d74ef39d5fb11 (diff) | |
download | hdf5-2181e7cb3cb5be0b9b3c1c0ccd8cc7617e7b310a.zip hdf5-2181e7cb3cb5be0b9b3c1c0ccd8cc7617e7b310a.tar.gz hdf5-2181e7cb3cb5be0b9b3c1c0ccd8cc7617e7b310a.tar.bz2 |
[svn-r12969] Bug fix.
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/tattr.c')
-rw-r--r-- | test/tattr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/tattr.c b/test/tattr.c index 4297316..bb33224 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -1398,8 +1398,8 @@ test_attr_dtype_shared(void) int data=8; /* Data to write */ int rdata=0; /* Read read in */ H5G_stat_t statbuf; /* Object's information */ - off_t empty_filesize; /* Size of empty file */ - off_t filesize; /* Size of file after modifications */ + h5_stat_size_t empty_filesize; /* Size of empty file */ + h5_stat_size_t filesize; /* Size of file after modifications */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1415,7 +1415,7 @@ test_attr_dtype_shared(void) /* Get size of file */ empty_filesize=h5_get_file_size(FILENAME); - if(empty_filesize==0) + if(empty_filesize<0) TestErrPrintf("Line %d: file size wrong!\n",__LINE__); /* Re-open file */ |