summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-11 01:04:11 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-11 01:04:11 +0100
commit5926cccae202f1b8869017d4bdaf9e9ce371bba6 (patch)
treeb3bd75bb7232b3a64b7e4cb67e542dc3f8b4172a /src/shared
parent8afbb8e1180dce3cb33a14fc3ec5afcf501104e6 (diff)
unit: instead of directly loading drop-in configuration snippets use conf_files_list_strv()
This has the benefit of allowing the usual overriding/masking knowledge everybody loves so much.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/strv.c15
-rw-r--r--src/shared/strv.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c
index 6b76d0eaef..aed45d2612 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -370,6 +370,21 @@ fail:
return NULL;
}
+int strv_extend(char ***l, const char *value) {
+ char **c;
+
+ if (!value)
+ return 0;
+
+ c = strv_append(*l, value);
+ if (!c)
+ return -ENOMEM;
+
+ strv_free(*l);
+ *l = c;
+ return 0;
+}
+
char **strv_uniq(char **l) {
char **i;
diff --git a/src/shared/strv.h b/src/shared/strv.h
index 45558d8960..44ba3d1530 100644
--- a/src/shared/strv.h
+++ b/src/shared/strv.h
@@ -37,6 +37,7 @@ unsigned strv_length(char **l);
char **strv_merge(char **a, char **b);
char **strv_merge_concat(char **a, char **b, const char *suffix);
char **strv_append(char **l, const char *s);
+int strv_extend(char ***l, const char *value);
char **strv_remove(char **l, const char *s);
char **strv_remove_prefix(char **l, const char *s);