diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-31 15:07:54 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-31 16:32:00 +0100 |
commit | fedfcdee6f55c3f183752b7fac4879bf41eed60b (patch) | |
tree | c37f5157e631d6e9426d8eb9905c8894061c0205 /src/libsystemd/sd-bus/bus-error.c | |
parent | bus: do not segfault on zeros in errno mapping table (diff) | |
download | systemd-fedfcdee6f55c3f183752b7fac4879bf41eed60b.tar.xz systemd-fedfcdee6f55c3f183752b7fac4879bf41eed60b.zip |
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/libsystemd/sd-bus/bus-error.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-error.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c index ad1a66da72..cfb8d147a7 100644 --- a/src/libsystemd/sd-bus/bus-error.c +++ b/src/libsystemd/sd-bus/bus-error.c @@ -35,7 +35,7 @@ #define BUS_ERROR_OOM SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_NO_MEMORY, "Out of memory") #define BUS_ERROR_FAILED SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_FAILED, "Operation failed") -SD_BUS_ERROR_MAPPING = { +SD_BUS_ERROR_MAPPING(sd_bus_standard) = { {"org.freedesktop.DBus.Error.Failed", EACCES}, {"org.freedesktop.DBus.Error.NoMemory", ENOMEM}, {"org.freedesktop.DBus.Error.ServiceUnknown", EHOSTUNREACH}, |