exception: add errno
sdbusplus is going to start requiring the get_errno
function on all exceptions. Since the exception defined
here is using the same dbus error as one already in
sd_bus, set the errno here to match:
src/libsystemd/sd-bus/bus-error.c:
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.Failed", EACCES),
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I07445fe3ce0e84e87fc6d75ffe1a9c8a28974641
diff --git a/src/sel_logger.cpp b/src/sel_logger.cpp
index afbbaee..5aa28ae 100644
--- a/src/sel_logger.cpp
+++ b/src/sel_logger.cpp
@@ -50,16 +50,21 @@
const char* name() const noexcept override
{
return "org.freedesktop.DBus.Error.Failed";
- };
+ }
const char* description() const noexcept override
{
return "internal error";
- };
+ }
const char* what() const noexcept override
{
return "org.freedesktop.DBus.Error.Failed: "
"internal error";
- };
+ }
+
+ int get_errno() const noexcept override
+ {
+ return EACCES;
+ }
};
#ifndef SEL_LOGGER_SEND_TO_LOGGING_SERVICE