From 0062a260b9852d3c9095f76b4e75475aac547007 Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Thu, 18 Jun 2015 15:24:10 -0400 Subject: [PATCH] Fix warning --- .../module/core/native/posix_SharedCode.h | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/beast/beast/module/core/native/posix_SharedCode.h b/src/beast/beast/module/core/native/posix_SharedCode.h index 11594f998..3d2e9b167 100644 --- a/src/beast/beast/module/core/native/posix_SharedCode.h +++ b/src/beast/beast/module/core/native/posix_SharedCode.h @@ -67,6 +67,21 @@ File File::getCurrentWorkingDirectory() return File (CharPointer_UTF8 (cwd)); } +// if this file doesn't exist, find a parent of it that does.. +inline +bool beast_doStatFS (File f, struct statfs& result) +{ + for (int i = 5; --i >= 0;) + { + if (f.exists()) + break; + + f = f.getParentDirectory(); + } + + return statfs (f.getFullPathName().toUTF8(), &result) == 0; +} + //============================================================================== namespace { @@ -85,20 +100,6 @@ namespace && BEAST_STAT (fileName.toUTF8(), &info) == 0; } - // if this file doesn't exist, find a parent of it that does.. - bool beast_doStatFS (File f, struct statfs& result) - { - for (int i = 5; --i >= 0;) - { - if (f.exists()) - break; - - f = f.getParentDirectory(); - } - - return statfs (f.getFullPathName().toUTF8(), &result) == 0; - } - void updateStatInfoForFile (const String& path, bool* const isDir, std::int64_t* const fileSize, Time* const modTime, Time* const creationTime, bool* const isReadOnly) {