]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: log the exact command we exec
authorTycho Andersen <tycho.andersen@canonical.com>
Fri, 18 Mar 2016 16:19:36 +0000 (10:19 -0600)
committerTycho Andersen <tycho.andersen@canonical.com>
Fri, 18 Mar 2016 16:19:36 +0000 (10:19 -0600)
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/criu.c

index a745806a54db9c0536b2a6cfabe49f80cec55681..a0c671894fe2ef1b394c40c15e1c9b5bfe642ff0 100644 (file)
@@ -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
@@ -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: