summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-05 18:57:21 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-05 19:03:10 +0100
commit4de33e7f3238a6fe616e61139ab87e221572e5e5 (patch)
tree14970ba5ecce65e9003e0e9d77d1ef53a337b77d /src/shared
parent69629de9c820dd41fffb1bf9b69d6d5b319c19c9 (diff)
systemd-run: make sure --nice=, --uid=, --gid=, --setenv= also work in --scope mode
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 67706dc381..1ef0b26a25 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -527,3 +527,18 @@ void strv_print(char **l) {
STRV_FOREACH(s, l)
puts(*s);
}
+
+int strv_extendf(char ***l, const char *format, ...) {
+ va_list ap;
+ char *x;
+ int r;
+
+ va_start(ap, format);
+ r = vasprintf(&x, format, ap);
+ va_end(ap);
+
+ if (r < 0)
+ return -ENOMEM;
+
+ return strv_consume(l, x);
+}
diff --git a/src/shared/strv.h b/src/shared/strv.h
index 618951c5e3..2dc2bc6c49 100644
--- a/src/shared/strv.h
+++ b/src/shared/strv.h
@@ -39,6 +39,7 @@ unsigned strv_length(char * const *l) _pure_;
int strv_extend_strv(char ***a, char **b);
int strv_extend_strv_concat(char ***a, char **b, const char *suffix);
int strv_extend(char ***l, const char *value);
+int strv_extendf(char ***l, const char *format, ...);
int strv_push(char ***l, char *value);
int strv_consume(char ***l, char *value);