提交 23891e94 编写于 作者: H Heikki Linnakangas

Move function to reduce diff vs. upstream.

This is pretty trivial, but every little helps.
上级 ed0ca498
......@@ -1342,28 +1342,6 @@ FileSync(File file)
return returnCode;
}
/*
* Get the size of a physical file by using fstat()
*
* Returns size in bytes if successful, < 0 otherwise
*/
int64
FileDiskSize(File file)
{
int returnCode = 0;
returnCode = FileAccess(file);
if (returnCode < 0)
return returnCode;
struct stat buf;
returnCode = fstat(VfdCache[file].fd, &buf);
if (returnCode < 0)
return returnCode;
return (int64) buf.st_size;
}
int64
FileSeek(File file, int64 offset, int whence)
{
......@@ -1427,6 +1405,28 @@ FileSeek(File file, int64 offset, int whence)
return VfdCache[file].seekPos;
}
/*
* Get the size of a physical file by using fstat()
*
* Returns size in bytes if successful, < 0 otherwise
*/
int64
FileDiskSize(File file)
{
int returnCode = 0;
struct stat buf;
returnCode = FileAccess(file);
if (returnCode < 0)
return returnCode;
returnCode = fstat(VfdCache[file].fd, &buf);
if (returnCode < 0)
return returnCode;
return (int64) buf.st_size;
}
int64
FileNonVirtualCurSeek(File file)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册