summaryrefslogtreecommitdiff
path: root/src/shared/bus-errors.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-31 10:07:54 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-31 11:32:00 -0400
commitfedfcdee6f55c3f183752b7fac4879bf41eed60b (patch)
treec37f5157e631d6e9426d8eb9905c8894061c0205 /src/shared/bus-errors.h
parent5e071f200c4cc86443af07a876ee0e1c2901fda1 (diff)
Make bus errno mappings non-static
__attribute__((used)) is not enough to force static variables to be carried over to a compiled program from a library. Mappings defined in libsystemd-shared.a were not visible in the compiled binaries. To ensure that the mappings are present in the final binary, the tables are made non-static and are given a real unique name by which they can be referenced. To use a mapping defined not in the local compilation unit (e.g. in a library) a reference to the mapping table is added. This is done by including a declaration in the header file. Expected values in test-engine are fixed to reflect the new mappings.
Diffstat (limited to 'src/shared/bus-errors.h')
-rw-r--r--src/shared/bus-errors.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/bus-errors.h b/src/shared/bus-errors.h
index 504ab1f796..1bf19c3f39 100644
--- a/src/shared/bus-errors.h
+++ b/src/shared/bus-errors.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "sd-bus.h"
+
#define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit"
#define BUS_ERROR_NO_UNIT_FOR_PID "org.freedesktop.systemd1.NoUnitForPID"
#define BUS_ERROR_UNIT_EXISTS "org.freedesktop.systemd1.UnitExists"
@@ -67,3 +69,5 @@
#define BUS_ERROR_CNAME_LOOP "org.freedesktop.resolve1.CNameLoop"
#define BUS_ERROR_ABORTED "org.freedesktop.resolve1.Aborted"
#define _BUS_ERROR_DNS "org.freedesktop.resolve1.DnsError."
+
+SD_BUS_ERROR_MAPPING_USE(systemd_shared);