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