X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=execute.c;h=4c6aa4eea98cc1f1703c483ab18d2385a2b59f98;hb=f62c0e4f30a96bcb0cfeae607d729a6658bfae83;hp=8720af9e2579815420af8d4dd876391829f980c3;hpb=451a074fd589fd90aff91fcf89b2e599b20ae6a0;p=elogind.git diff --git a/execute.c b/execute.c index 8720af9e2..4c6aa4eea 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",