]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands: port lxc_cmd_get_init_pidfd() to new helpers
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Feb 2021 09:17:49 +0000 (10:17 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Feb 2021 11:03:25 +0000 (12:03 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c

index 91d65a7f7d7740baac17cf855a3eb5a900cc221e..afbbf6abc80d0fb12ee8cd9e0f04f9404599fd0b 100644 (file)
@@ -590,16 +590,10 @@ static int lxc_cmd_get_init_pid_callback(int fd, struct lxc_cmd_req *req,
 int lxc_cmd_get_init_pidfd(const char *name, const char *lxcpath)
 {
        bool stopped = false;
-       struct lxc_cmd_rr cmd = {
-               .req = {
-                       .cmd = LXC_CMD_GET_INIT_PIDFD,
-               },
-               .rsp = {
-                       .data = INT_TO_PTR(-EBADF),
-                       .ret = ENOSYS,
-               },
-       };
        int pidfd, ret;
+       struct lxc_cmd_rr cmd;
+
+       lxc_cmd_init(&cmd, LXC_CMD_GET_INIT_PIDFD);
 
        ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL);
        if (ret < 0)