696e2f2
From 6f3bf5e9e0ba04df7ffc85b6a21d296c2902edcb Mon Sep 17 00:00:00 2001
696e2f2
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
696e2f2
Date: Fri, 12 Aug 2016 23:50:58 -0400
696e2f2
Subject: [PATCH] shared/install: remove unused paramater and add more comments
696e2f2
696e2f2
(cherry picked from commit ff56349d5a83f2202ed331f232f5d73467db482c)
696e2f2
---
696e2f2
 src/shared/install.c | 18 ++++++++++++------
696e2f2
 1 file changed, 12 insertions(+), 6 deletions(-)
696e2f2
696e2f2
diff --git a/src/shared/install.c b/src/shared/install.c
696e2f2
index 2d9306058d..5e0f9c5d0c 100644
696e2f2
--- a/src/shared/install.c
696e2f2
+++ b/src/shared/install.c
696e2f2
@@ -903,6 +903,10 @@ static int install_info_may_process(
696e2f2
         return 0;
696e2f2
 }
696e2f2
 
696e2f2
+/**
696e2f2
+ * Adds a new UnitFileInstallInfo entry under name in the InstallContext.will_process
696e2f2
+ * hashmap, or retrieves the existing one if already present.
696e2f2
+ */
696e2f2
 static int install_info_add(
696e2f2
                 InstallContext *c,
696e2f2
                 const char *name,
696e2f2
@@ -1334,9 +1338,8 @@ static int install_info_follow(
696e2f2
 }
696e2f2
 
696e2f2
 /**
696e2f2
- * Search for the unit file. If the unit name is a symlink,
696e2f2
- * follow the symlink to the target, maybe more than once.
696e2f2
- * Propagate the instance name if present.
696e2f2
+ * Search for the unit file. If the unit name is a symlink, follow the symlink to the
696e2f2
+ * target, maybe more than once. Propagate the instance name if present.
696e2f2
  */
696e2f2
 static int install_info_traverse(
696e2f2
                 UnitFileScope scope,
696e2f2
@@ -1421,6 +1424,10 @@ static int install_info_traverse(
696e2f2
         return 0;
696e2f2
 }
696e2f2
 
696e2f2
+/**
696e2f2
+ * Call install_info_add() with name_or_path as the path (if name_or_path starts with "/")
696e2f2
+ * or the name (otherwise). root_dir is prepended to the path.
696e2f2
+ */
696e2f2
 static int install_info_add_auto(
696e2f2
                 InstallContext *c,
696e2f2
                 const LookupPaths *paths,
696e2f2
@@ -2685,7 +2692,6 @@ static int preset_prepare_one(
696e2f2
                 InstallContext *plus,
696e2f2
                 InstallContext *minus,
696e2f2
                 LookupPaths *paths,
696e2f2
-                UnitFilePresetMode mode,
696e2f2
                 const char *name,
696e2f2
                 Presets presets,
696e2f2
                 UnitFileChange **changes,
696e2f2
@@ -2748,7 +2754,7 @@ int unit_file_preset(
696e2f2
                 return r;
696e2f2
 
696e2f2
         STRV_FOREACH(i, files) {
696e2f2
-                r = preset_prepare_one(scope, &plus, &minus, &paths, mode, *i, presets, changes, n_changes);
696e2f2
+                r = preset_prepare_one(scope, &plus, &minus, &paths, *i, presets, changes, n_changes);
696e2f2
                 if (r < 0)
696e2f2
                         return r;
696e2f2
         }
696e2f2
@@ -2809,7 +2815,7 @@ int unit_file_preset_all(
696e2f2
                                 continue;
696e2f2
 
696e2f2
                         /* we don't pass changes[] in, because we want to handle errors on our own */
696e2f2
-                        r = preset_prepare_one(scope, &plus, &minus, &paths, mode, de->d_name, presets, NULL, 0);
696e2f2
+                        r = preset_prepare_one(scope, &plus, &minus, &paths, de->d_name, presets, NULL, 0);
696e2f2
                         if (r == -ERFKILL)
696e2f2
                                 r = unit_file_changes_add(changes, n_changes,
696e2f2
                                                           UNIT_FILE_IS_MASKED, de->d_name, NULL);