]> git.proxmox.com Git - mirror_lxc.git/commitdiff
commands: delete meaningless comments
authorLong Wang <w@laoqinren.net>
Sun, 9 Jul 2017 00:08:54 +0000 (08:08 +0800)
committerLong Wang <w@laoqinren.net>
Sun, 9 Jul 2017 00:08:54 +0000 (08:08 +0800)
Signed-off-by: Long Wang <w@laoqinren.net>
src/lxc/commands.c
src/lxc/commands_utils.c

index 4540658c6b6b42ddf0ed52eaa3bccade44353136..942e95a2942ef3d51aff9aac1bf7aee9c3e33e0d 100644 (file)
@@ -116,7 +116,7 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
  */
 static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
 {
-       int ret,rspfd;
+       int ret, rspfd;
        struct lxc_cmd_rsp *rsp = &cmd->rsp;
 
        ret = lxc_abstract_unix_recv_fds(sock, &rspfd, 1, rsp, sizeof(*rsp));
@@ -212,11 +212,6 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
        int client_fd;
        int ret = -1;
 
-       /* -2 here because this is an abstract unix socket so it needs a
-        * leading \0, and we null terminate, so it needs a trailing \0.
-        * Although null termination isn't required by the API, we do it anyway
-        * because we print the sockname out sometimes.
-        */
        client_fd = lxc_cmd_connect(name, lxcpath, hashed_sock_name);
        if (client_fd < 0 && client_fd == -ECONNREFUSED)
                return -ECONNREFUSED;
@@ -291,11 +286,6 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
 
        *stopped = 0;
 
-       /* -2 here because this is an abstract unix socket so it needs a
-        * leading \0, and we null terminate, so it needs a trailing \0.
-        * Although null termination isn't required by the API, we do it anyway
-        * because we print the sockname out sometimes.
-        */
        TRACE("command %s tries to connect command socket",
              lxc_cmd_str(cmd->req.cmd));
 
index 5e589d2af2037daeeeeee631e22b5de0fdfe799e..23a0b95049daa566c7b0e90a61955010849a00d5 100644 (file)
@@ -168,13 +168,13 @@ int lxc_cmd_connect(const char *name, const char *lxcpath,
        int ret, client_fd;
        char path[sizeof(((struct sockaddr_un *)0)->sun_path)] = {0};
        char *offset = &path[1];
-       size_t len = sizeof(path) - 2;
 
        /* -2 here because this is an abstract unix socket so it needs a
         * leading \0, and we null terminate, so it needs a trailing \0.
         * Although null termination isn't required by the API, we do it anyway
         * because we print the sockname out sometimes.
         */
+       size_t len = sizeof(path) - 2;
        ret = lxc_make_abstract_socket_name(offset, len, name, lxcpath,
                                            hashed_sock_name, "command");
        if (ret < 0)