From fedfcdee6f55c3f183752b7fac4879bf41eed60b Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 31 Oct 2014 10:07:54 -0400 Subject: 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. --- src/libsystemd/sd-bus/test-bus-error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsystemd/sd-bus/test-bus-error.c') diff --git a/src/libsystemd/sd-bus/test-bus-error.c b/src/libsystemd/sd-bus/test-bus-error.c index aff34a90cd..ae894e39fd 100644 --- a/src/libsystemd/sd-bus/test-bus-error.c +++ b/src/libsystemd/sd-bus/test-bus-error.c @@ -130,7 +130,7 @@ static void test_errno_mapping_standard(void) { assert_se(sd_bus_error_set(NULL, "System.Error.WHATSIT", NULL) == -EIO); } -SD_BUS_ERROR_MAPPING = { +SD_BUS_ERROR_MAPPING(test) = { {"org.freedesktop.custom-dbus-error", 5}, {"org.freedesktop.custom-dbus-error-2", 52}, }; -- cgit v1.2.3-54-g00ecf