summaryrefslogtreecommitdiff
path: root/src/shared/strv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-02-11 23:48:36 +0100
committerLennart Poettering <lennart@poettering.net>2013-02-11 23:54:30 +0100
commitfabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda (patch)
tree11a1e012f820f3e4f30e5d60fd75f81dddaa1310 /src/shared/strv.c
parent853b8397acdebdd44777810e560403bae3756859 (diff)
binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services that work on .d/ directories
This unifies much of the logic behind them: - All four will now ofllow the rule that the earlier file and earlier assignment in the .d/ directories wins. Before, sysctl was the only outlier, where the later setting always won. - All four now support getopt() and --help on the command line. - All four can now handle specification of configuration file names on the command line to apply. The tools will automatically find them, and apply them. Previously only tmpfiles could do that. This is useful for %post scripts in RPMs and suchlike. - This fixes various error path issues in conf_files_list()
Diffstat (limited to 'src/shared/strv.c')
-rw-r--r--src/shared/strv.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c
index ee0b71ece0..ec25755289 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -504,6 +504,22 @@ char **strv_parse_nulstr(const char *s, size_t l) {
return v;
}
+char **strv_split_nulstr(const char *s) {
+ const char *i;
+ char **r = NULL;
+
+ NULSTR_FOREACH(i, s)
+ if (strv_extend(&r, i) < 0) {
+ strv_free(r);
+ return NULL;
+ }
+
+ if (!r)
+ return strv_new(NULL, NULL);
+
+ return r;
+}
+
bool strv_overlap(char **a, char **b) {
char **i, **j;