]> 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>
Fri, 26 Feb 2021 20:28:33 +0000 (21:28 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c

index aaf5e500f9781c8f07419688ce694a54be1b2ea9..355525d2e21adc7ada0112df181ed3d0b30b1be4 100644 (file)
@@ -1681,9 +1681,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: