From f156e60c66fa23dda076e4a12538fb63ee0daba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 23 Dec 2019 23:06:38 +0100 Subject: [PATCH] core: unit_label_path(): take const unit --- src/core/unit.c | 4 +++- src/core/unit.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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);