chiark / gitweb /
Make bus errno mappings non-static
[elogind.git] / src / libsystemd / sd-bus / bus-error.c
index 2e64b92..cfb8d14 100644 (file)
@@ -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},
@@ -80,7 +80,7 @@ static int bus_error_mapping_lookup(const char *name, size_t len) {
         const sd_bus_name_error_mapping *m;
 
         for (m = __start_sd_bus_errnomap; m < __stop_sd_bus_errnomap; m++)
-                if (strneq(m->name, name, len))
+                if (m->name && strneq(m->name, name, len))
                         return m->code;
 
         return EIO;