mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-28 02:33:29 +02: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:
parent
db95b94c8c
commit
d67c9ea6f2
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user