commands: port lxc_cmd_get_init_pid() to new helpers

parent caa0d614
...@@ -555,16 +555,11 @@ static int validate_string_request(int fd, const struct lxc_cmd_req *req) ...@@ -555,16 +555,11 @@ static int validate_string_request(int fd, const struct lxc_cmd_req *req)
pid_t lxc_cmd_get_init_pid(const char *name, const char *lxcpath) pid_t lxc_cmd_get_init_pid(const char *name, const char *lxcpath)
{ {
bool stopped = false; bool stopped = false;
pid_t pid = -1;
struct lxc_cmd_rr cmd = {
.req = {
.cmd = LXC_CMD_GET_INIT_PID
},
.rsp = {
.data = PID_TO_PTR(pid)
}
};
int ret; int ret;
pid_t pid;
struct lxc_cmd_rr cmd;
lxc_cmd_init(&cmd, LXC_CMD_GET_INIT_PID);
ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment