fs/FileInfo: add fstat() wrapper

This commit is contained in:
Max Kellermann
2023-10-07 12:37:26 +02:00
parent 1ca5d6baa6
commit 34182990ef
3 changed files with 15 additions and 8 deletions

View File

@@ -73,12 +73,7 @@ FileReader::GetFileInfo() const
{
assert(IsDefined());
FileInfo info;
const bool success = fstat(fd.Get(), &info.st) == 0;
if (!success)
throw MakeErrno("Failed to access file");
return info;
return FileInfo{fd};
}
std::size_t