[lxc-devel] [lxc/master] delete comments

0x0916 on Github lxc-bot at linuxcontainers.org
Sun Jul 9 00:16:57 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170709/739025f8/attachment.bin>
-------------- next part --------------
From 2945ea97789df4af8d03806e4d9c5b256d04da0b Mon Sep 17 00:00:00 2001
From: Long Wang <w at laoqinren.net>
Date: Sun, 9 Jul 2017 08:08:54 +0800
Subject: [PATCH 1/2] commands: delete meaningless comments

Signed-off-by: Long Wang <w at laoqinren.net>
---
 src/lxc/commands.c       | 12 +-----------
 src/lxc/commands_utils.c |  2 +-
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/lxc/commands.c b/src/lxc/commands.c
index 4540658c6..942e95a29 100644
--- a/src/lxc/commands.c
+++ b/src/lxc/commands.c
@@ -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));
 
diff --git a/src/lxc/commands_utils.c b/src/lxc/commands_utils.c
index 5e589d2af..23a0b9504 100644
--- a/src/lxc/commands_utils.c
+++ b/src/lxc/commands_utils.c
@@ -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)

From 1e8cfdf6f9fd4d2e4e2ff6e119faff080c92deb1 Mon Sep 17 00:00:00 2001
From: Long Wang <w at laoqinren.net>
Date: Sun, 9 Jul 2017 08:10:34 +0800
Subject: [PATCH 2/2] commonds: fix typo

Signed-off-by: Long Wang <w at laoqinren.net>
---
 src/lxc/commands.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/commands.c b/src/lxc/commands.c
index 942e95a29..c6ece2cc7 100644
--- a/src/lxc/commands.c
+++ b/src/lxc/commands.c
@@ -260,7 +260,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
  * request and collect the response
  *
  * @name           : name of container to connect to
- * @cmd            : command with initialized reqest to send
+ * @cmd            : command with initialized request to send
  * @stopped        : output indicator if the container was not running
  * @lxcpath        : the lxcpath in which the container is running
  *


More information about the lxc-devel mailing list