Does now return the correct size if the handle belongs to a real file.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4697 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -108,16 +108,16 @@ Handle::GetName(char *nameBuffer, size_t bufferSize) const
|
|||||||
off_t
|
off_t
|
||||||
Handle::Size() const
|
Handle::Size() const
|
||||||
{
|
{
|
||||||
|
struct stat stat;
|
||||||
|
if (fstat(fHandle, &stat) == B_OK) {
|
||||||
|
if (stat.st_size == 0) {
|
||||||
// ToDo: fix this!
|
// ToDo: fix this!
|
||||||
return 1024LL * 1024 * 1024 * 1024;
|
return 1024LL * 1024 * 1024 * 1024;
|
||||||
// 1024 GB
|
// 1024 GB
|
||||||
/* struct stat stat;
|
}
|
||||||
if (fstat(fHandle, &stat) == B_OK)
|
|
||||||
return stat.st_size;
|
return stat.st_size;
|
||||||
|
}
|
||||||
// stat apparently doesn't work with devices
|
|
||||||
|
return 0LL;
|
||||||
return 0LL;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user