summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-02-14 01:05:55 +0100
committerLennart Poettering <lennart@poettering.net>2010-02-14 01:05:55 +0100
commita6a80b4f440bcc1c6087572503c08a72ee674075 (patch)
treea3764b68a7328fde5be458a2d3a76aea9c9da44e /execute.c
parentc18315a88da3864f29908ad299750f98e6160f42 (diff)
execute: simplify appending to execution list
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/execute.c b/execute.c
index 8720af9e25..4c6aa4eea9 100644
--- a/execute.c
+++ b/execute.c
@@ -749,6 +749,20 @@ void exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix) {
exec_command_dump(c, f, prefix);
}
+void exec_command_append_list(ExecCommand **l, ExecCommand *e) {
+ ExecCommand *end;
+
+ assert(l);
+ assert(e);
+
+ if (*l) {
+ /* It's kinda important that we keep the order here */
+ LIST_FIND_TAIL(ExecCommand, command, *l, end);
+ LIST_INSERT_AFTER(ExecCommand, command, *l, end, e);
+ } else
+ *l = e;
+}
+
static const char* const exec_output_table[_EXEC_OUTPUT_MAX] = {
[EXEC_OUTPUT_CONSOLE] = "console",
[EXEC_OUTPUT_NULL] = "null",