Print the errno from a fail in the journal
When a file access fails, print the errno of the failure in the same
journal entry the filename is already printed.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I20d268f563cf1bbfa2a5f9780c02998d075f5275
diff --git a/targets.hpp b/targets.hpp
index c1a2feb..51e98a5 100644
--- a/targets.hpp
+++ b/targets.hpp
@@ -154,9 +154,9 @@
metadata::CALLOUT_ERRNO(e.code().value()),
metadata::CALLOUT_DEVICE_PATH(devPath.c_str()));
- log<level::INFO>(
- fmt::format("Failing sysfs file: {}", sysfsFullPath)
- .c_str());
+ log<level::INFO>(fmt::format("Failing sysfs file: {} errno: {}",
+ sysfsFullPath, e.code().value())
+ .c_str());
}
static constexpr bool deferSignals = true;