]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands: be more explicit during command processing
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 22 Feb 2021 17:24:49 +0000 (18:24 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 23 Feb 2021 12:57:45 +0000 (13:57 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c

index e61454dfd80ef63baafb1fd88b18e353c2a7ff8b..0ccb1d8f3fa81667476399f3853f732ec2384c7c 100644 (file)
@@ -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: