diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2010-08-03 23:35:42 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2010-08-03 23:35:42 (GMT) |
commit | 41f0057dbc1bb5333b6a41ed9d5a4d1942964808 (patch) | |
tree | 7e13e5933db3a0b58db06536f1a94d2801bd5949 /test | |
parent | 2d8a18a1fdac369b39f8160eb22b1562406e31de (diff) | |
download | hdf5-41f0057dbc1bb5333b6a41ed9d5a4d1942964808.zip hdf5-41f0057dbc1bb5333b6a41ed9d5a4d1942964808.tar.gz hdf5-41f0057dbc1bb5333b6a41ed9d5a4d1942964808.tar.bz2 |
[svn-r19167] Bug fix: 1917.
Description:
test/big incorrectly determined not able to write files larger than 2GB and
skipped the SEC2 and STDIO driver tests. The reason was because it was using
off_t while the SEC2 driver is using lseek64 which expects off64_t type.
Solution:
Created a new HDoff_t which is set to off_t or off64_t or other appropriate
type depending on which of lseek or lseek64 is available. Changed SEC2 file
driver and the big test to use this common definition.
Tested:
In BP (AIX), using --enable and --disable-largefile, for both 32 and 64 bits
modes. Did not do h5committest because: 1. the error was exposed in the remote
BP machine; 2. the change is trivial.
Note that STDIO driver failed when --disable-largefile is used. That is an
error in the STDIO driver code that is being fixed.
Diffstat (limited to 'test')
-rw-r--r-- | test/big.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -32,8 +32,7 @@ const char *FILENAME[] = { #define WRT_SIZE 4*1024 #define FAMILY_SIZE 1024*1024*1024 -/* Define big file as 2GB */ -#define BIG_FILE (off_t)0x80000000UL +#define GB (HDoff_t)0x40000000L #define MAX_TRIES 100 @@ -165,15 +164,15 @@ supports_big(void) if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) return 0; /* Write a few bytes at 2GB */ - if (HDlseek(fd, BIG_FILE, SEEK_SET)!=BIG_FILE) return 0; + if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) return 0; if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; /* Write a few bytes at 4GB */ - if (HDlseek(fd, 2*BIG_FILE, SEEK_SET) != 2*BIG_FILE) return 0; + if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) return 0; if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; if (HDclose(fd) < 0) return 0; - if (HDunlink("y.h5") < 0) return 0; + if (HDremove("y.h5") < 0) return 0; return (1); } |