X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=execute.c;h=f3b4df930f24f8a768d3b7150c65573efc33f541;hb=acbb02252a38214ecba3aa8a5c9b3669f9c9317e;hp=bcaa4e959d580c0d3ed65a9f5615b1e2367f416d;hpb=44d8db9e5aa86165c97289f6c78a7e42bac78362;p=elogind.git diff --git a/execute.c b/execute.c index bcaa4e959..f3b4df930 100644 --- a/execute.c +++ b/execute.c @@ -11,6 +11,7 @@ #include "strv.h" #include "macro.h" #include "util.h" +#include "log.h" static int close_fds(int except[], unsigned n_except) { DIR *d; @@ -111,6 +112,8 @@ int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds, assert(ret); assert(fds || n_fds <= 0); + log_debug("About to execute %s", command->path); + if ((pid = fork()) < 0) return -errno; @@ -250,7 +253,6 @@ void exec_command_free_array(ExecCommand **c, unsigned n) { } } - void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { assert(c); assert(f); @@ -286,7 +288,7 @@ char *exec_command_line(ExecCommand *c) { assert(c); assert(c->argv); - k = 0; + k = 1; STRV_FOREACH(a, c->argv) k += strlen(*a)+3; @@ -310,6 +312,8 @@ char *exec_command_line(ExecCommand *c) { } + *p = 0; + /* FIXME: this doesn't really handle arguments that have * spaces and ticks in them */