mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 13:47:10 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user