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:
parent
2430b4ed28
commit
7be68ba5e7
@ -108,16 +108,16 @@ Handle::GetName(char *nameBuffer, size_t bufferSize) const
|
||||
off_t
|
||||
Handle::Size() const
|
||||
{
|
||||
// ToDo: fix this!
|
||||
return 1024LL * 1024 * 1024 * 1024;
|
||||
// 1024 GB
|
||||
/* struct stat stat;
|
||||
if (fstat(fHandle, &stat) == B_OK)
|
||||
struct stat stat;
|
||||
if (fstat(fHandle, &stat) == B_OK) {
|
||||
if (stat.st_size == 0) {
|
||||
// ToDo: fix this!
|
||||
return 1024LL * 1024 * 1024 * 1024;
|
||||
// 1024 GB
|
||||
}
|
||||
return stat.st_size;
|
||||
|
||||
// stat apparently doesn't work with devices
|
||||
}
|
||||
|
||||
return 0LL;
|
||||
*/
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user