From 4bc203dd1f49f90e91a83029cd36eb3a1604c7a0 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 27 Dec 2016 02:02:50 +0100 Subject: [PATCH] fix(fs): Output error if statvfs() fails Refs #271 --- src/modules/fs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/fs.cpp b/src/modules/fs.cpp index 5520430a..d71219ad 100644 --- a/src/modules/fs.cpp +++ b/src/modules/fs.cpp @@ -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; }