From 32fd8d4f85534705eee90e828d58c27f870e215e Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 22 Feb 2021 18:24:49 +0100 Subject: [PATCH] commands: be more explicit during command processing Signed-off-by: Christian Brauner --- src/lxc/commands.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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: -- 2.47.2