From 7be68ba5e7902901f24164d312f6cbab7b8bc7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 15 Sep 2003 22:29:05 +0000 Subject: [PATCH] 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 --- src/tests/kernel/boot/loader/Handle.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tests/kernel/boot/loader/Handle.cpp b/src/tests/kernel/boot/loader/Handle.cpp index ce397896a0..e9f1b47877 100644 --- a/src/tests/kernel/boot/loader/Handle.cpp +++ b/src/tests/kernel/boot/loader/Handle.cpp @@ -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; -*/ }