mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: warn when statvfs() fails in KDiskFreeSpaceInfo::freeSpaceInfo()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f8443ced0b
commit
a3f47ed50f
1 changed files with 5 additions and 1 deletions
|
@ -28,9 +28,10 @@
|
|||
#include <QtCore/QFile>
|
||||
|
||||
#include <kmountpoint.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
class KDiskFreeSpaceInfo::Private : public QSharedData
|
||||
{
|
||||
|
@ -121,6 +122,9 @@ KDiskFreeSpaceInfo KDiskFreeSpaceInfo::freeSpaceInfo( const QString& path )
|
|||
info.d->available = statvfs_buf.f_bavail * blksize;
|
||||
info.d->size = statvfs_buf.f_blocks * blksize;
|
||||
info.d->valid = true;
|
||||
} else {
|
||||
const int savederrno = errno;
|
||||
kWarning() << qt_error_string(savederrno);
|
||||
}
|
||||
|
||||
return info;
|
||||
|
|
Loading…
Add table
Reference in a new issue