1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00

core: suppress gcc warnings on selinux-less systems

This commit is contained in:
Lennart Poettering 2013-12-12 15:58:31 +01:00
parent 01390ca8a2
commit ad5b215d1b

View File

@ -211,6 +211,7 @@ failed:
return 0; return 0;
} }
#ifdef HAVE_SELINUX
static int selinux_filter(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { static int selinux_filter(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
Manager *m = userdata; Manager *m = userdata;
const char *verb, *path; const char *verb, *path;
@ -276,6 +277,7 @@ static int selinux_filter(sd_bus *bus, sd_bus_message *message, void *userdata,
return 0; return 0;
} }
#endif
static int bus_job_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) { static int bus_job_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error) {
Manager *m = userdata; Manager *m = userdata;
@ -534,11 +536,13 @@ static int bus_setup_api_vtables(Manager *m, sd_bus *bus) {
assert(m); assert(m);
assert(bus); assert(bus);
#ifdef HAVE_SELINUX
r = sd_bus_add_filter(bus, selinux_filter, m); r = sd_bus_add_filter(bus, selinux_filter, m);
if (r < 0) { if (r < 0) {
log_error("Failed to add SELinux access filter: %s", strerror(-r)); log_error("Failed to add SELinux access filter: %s", strerror(-r));
return r; return r;
} }
#endif
r = sd_bus_add_object_vtable(bus, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", bus_manager_vtable, m); r = sd_bus_add_object_vtable(bus, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", bus_manager_vtable, m);
if (r < 0) { if (r < 0) {