]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: unit_label_path(): take const unit
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 23 Dec 2019 22:06:38 +0000 (23:06 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Feb 2020 17:36:19 +0000 (18:36 +0100)
src/core/unit.c
src/core/unit.h

index 3f616e7acf1c9a288cce0b30efe4484ff6d8bb7b..279619f039a6b08c263a4b35b47ac0f26ecdb07c 100644 (file)
@@ -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. */
 
index 38d681dfb86de30ebad091b39b755335ba52a356..999c7a7d83c359bc334e5a22bfc25b972026616f 100644 (file)
@@ -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);