On AIX, statfs takes a non-const char* as the first parameter. Fixing it.

Since the function does not change the content of the variable, it is safe
to remove the constness of the variable for UNIX platforms.
This commit is contained in:
Mathäus Mendel 2016-03-07 16:31:07 -03:00
parent db95b94c8c
commit d67c9ea6f2

View File

@ -419,7 +419,7 @@ FileImpl::FileSizeImpl FileImpl::totalSpaceImpl() const
poco_assert(!_path.empty());
struct statfs stats;
if (statfs(_path.c_str(), &stats) != 0)
if (statfs(const_cast<char*>(_path.c_str()), &stats) != 0)
handleLastErrorImpl(_path);
return (FileSizeImpl)stats.f_blocks * (FileSizeImpl)stats.f_bsize;
@ -431,7 +431,7 @@ FileImpl::FileSizeImpl FileImpl::usableSpaceImpl() const
poco_assert(!_path.empty());
struct statfs stats;
if (statfs(_path.c_str(), &stats) != 0)
if (statfs(const_cast<char*>(_path.c_str()), &stats) != 0)
handleLastErrorImpl(_path);
return (FileSizeImpl)stats.f_bavail * (FileSizeImpl)stats.f_bsize;
@ -443,7 +443,7 @@ FileImpl::FileSizeImpl FileImpl::freeSpaceImpl() const
poco_assert(!_path.empty());
struct statfs stats;
if (statfs(_path.c_str(), &stats) != 0)
if (statfs(const_cast<char*>(_path.c_str()), &stats) != 0)
handleLastErrorImpl(_path);
return (FileSizeImpl)stats.f_bfree * (FileSizeImpl)stats.f_bsize;