diff --git a/src/core/unit.c b/src/core/unit.c index 3f616e7acf..279619f039 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5803,9 +5803,11 @@ bool unit_needs_console(Unit *u) { return exec_context_may_touch_console(ec); } -const char *unit_label_path(Unit *u) { +const char *unit_label_path(const Unit *u) { const char *p; + assert(u); + /* Returns the file system path to use for MAC access decisions, i.e. the file to read the SELinux label off * when validating access checks. */ diff --git a/src/core/unit.h b/src/core/unit.h index 38d681dfb8..999c7a7d83 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -842,7 +842,7 @@ int unit_warn_leftover_processes(Unit *u); bool unit_needs_console(Unit *u); -const char *unit_label_path(Unit *u); +const char *unit_label_path(const Unit *u); int unit_pid_attachable(Unit *unit, pid_t pid, sd_bus_error *error);