From: Christian Brauner Date: Thu, 25 Feb 2021 09:17:19 +0000 (+0100) Subject: commands: port lxc_cmd_get_init_pid() to new helpers X-Git-Tag: lxc-5.0.0~267^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22642823aca74f32c87390f7b9c2c25ab78fd638;p=thirdparty%2Flxc.git commands: port lxc_cmd_get_init_pid() to new helpers Signed-off-by: Christian Brauner --- diff --git a/src/lxc/commands.c b/src/lxc/commands.c index ba4fc81b9..91d65a7f7 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -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) { 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; + 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); if (ret < 0)