Skip to content

Commit

Permalink
c/r: log the exact command we exec
Browse files Browse the repository at this point in the history
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
  • Loading branch information
Tycho Andersen committed Mar 18, 2016
1 parent 72e7e16 commit cf4b07a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lxc/criu.c
Expand Up @@ -126,7 +126,7 @@ static void exec_criu(struct criu_opts *opts)
int netnr = 0;
struct lxc_list *it;

char buf[4096], tty_info[32];
char buf[4096], *pos, tty_info[32];

/* If we are currently in a cgroup /foo/bar, and the container is in a
* cgroup /lxc/foo, lxcfs will give us an ENOENT if some task in the
Expand Down Expand Up @@ -356,6 +356,15 @@ static void exec_criu(struct criu_opts *opts)

argv[argc] = NULL;

buf[0] = 0;
pos = buf;
for (i = 0; argv[i]; i++) {
pos = strncat(buf, argv[i], buf + sizeof(buf) - pos);
pos = strncat(buf, " ", buf + sizeof(buf) - pos);
}

INFO("execing: %s", buf);

#undef DECLARE_ARG
execv(argv[0], argv);
err:
Expand Down

0 comments on commit cf4b07a

Please sign in to comment.