From: Christian Brauner Date: Mon, 22 Feb 2021 17:24:49 +0000 (+0100) Subject: commands: be more explicit during command processing X-Git-Tag: lxc-5.0.0~273^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32fd8d4f85534705eee90e828d58c27f870e215e;p=thirdparty%2Flxc.git commands: be more explicit during command processing Signed-off-by: Christian Brauner --- diff --git a/src/lxc/commands.c b/src/lxc/commands.c index e61454dfd..0ccb1d8f3 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -1682,9 +1682,14 @@ static int lxc_cmd_handler(int fd, uint32_t events, void *data, } ret = lxc_cmd_process(fd, &req, handler, descr); - if (ret) { - /* This is not an error, but only a request to close fd. */ + if (ret < 0) { + DEBUG("Failed to process command %s; cleaning up client fd %d", lxc_cmd_str(req.cmd), fd); + goto out_close; + } else if (ret == LXC_CMD_REAP_CLIENT_FD) { + TRACE("Processed command %s; cleaning up client fd %d", lxc_cmd_str(req.cmd), fd); goto out_close; + } else { + TRACE("Processed command %s; keeping client fd %d", lxc_cmd_str(req.cmd), fd); } out: