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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-10-31 11:32:00 -04:00
parent 5e071f200c
commit fedfcdee6f
7 changed files with 24 additions and 10 deletions
+1 -1
View File
@@ -44,7 +44,7 @@
#define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n"
#define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
SD_BUS_ERROR_MAPPING = {
SD_BUS_ERROR_MAPPING(timedated) = {
{"org.freedesktop.timedate1.NoNTPSupport", ENOTSUP},
};