diff options
Diffstat (limited to 'src/core/execute.c')
-rw-r--r-- | src/core/execute.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 8c9dfde00a..07ec7a28d6 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2566,6 +2566,31 @@ int exec_command_set(ExecCommand *c, const char *path, ...) { return 0; } +int exec_command_append(ExecCommand *c, const char *path, ...) { + va_list ap; + char **l; + int r; + + assert(c); + assert(path); + + va_start(ap, path); + l = strv_new_ap(path, ap); + va_end(ap); + + if (!l) + return -ENOMEM; + + r = strv_extend_strv(&c->argv, l); + if (r < 0) { + strv_free(l); + return r; + } + + return 0; +} + + static int exec_runtime_allocate(ExecRuntime **rt) { if (*rt) |