mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
struct stat.st_size is of type off_t
This commit is contained in:
parent
4097dd9826
commit
308c2f764e
@ -118,16 +118,16 @@ static int ncio_spx_close(ncio *nciop, int doUnlink);
|
||||
* @par fd File Descriptor.
|
||||
* @return -1 on error, length of file (in bytes) otherwise.
|
||||
*/
|
||||
static size_t nc_get_filelen(const int fd) {
|
||||
static off_t nc_get_filelen(const int fd) {
|
||||
|
||||
size_t flen;
|
||||
off_t flen;
|
||||
|
||||
#ifdef HAVE_FILE_LENGTH_I64
|
||||
__int64 file_len = 0;
|
||||
if ((file_len = _filelengthi64(fd)) < 0) {
|
||||
return file_len;
|
||||
}
|
||||
flen = (size_t)file_len;
|
||||
flen = (off_t)file_len;
|
||||
|
||||
#else
|
||||
int res = 0;
|
||||
@ -243,7 +243,7 @@ fgrow2(const int fd, const off_t len)
|
||||
*/
|
||||
|
||||
|
||||
size_t file_len = nc_get_filelen(fd);
|
||||
off_t file_len = nc_get_filelen(fd);
|
||||
if(file_len < 0) return errno;
|
||||
if(len <= file_len)
|
||||
return NC_NOERR;
|
||||
|
Loading…
Reference in New Issue
Block a user