fix(fs): Output error if statvfs() fails

Refs #271
This commit is contained in:
Michael Carlberg 2016-12-27 02:02:50 +01:00
parent 55934c12a3
commit 4bc203dd1f
1 changed files with 2 additions and 1 deletions

View File

@ -56,12 +56,13 @@ namespace modules {
m_mounts.clear();
struct statvfs buffer {};
struct mntent* mnt = nullptr;
struct mntent* mnt{nullptr};
for (auto&& mountpoint : m_mountpoints) {
m_mounts.emplace_back(new fs_mount{mountpoint, false});
if (statvfs(mountpoint.c_str(), &buffer) == -1) {
m_log.err("%s: Failed to query filesystem (statvfs() error: %s)", name(), strerror(errno));
continue;
}