[lxc-devel] [lxd/master] checkfeature: Avoid double line break

stgraber on Github lxc-bot at linuxcontainers.org
Tue Oct 9 05:23:28 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181009/19c35508/attachment.bin>
-------------- next part --------------
From cfbafeb80da87f447f5314aff3830603cb9e9f06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 9 Oct 2018 01:22:18 -0400
Subject: [PATCH] checkfeature: Avoid double line break
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/main_checkfeature.go | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lxd/main_checkfeature.go b/lxd/main_checkfeature.go
index 724b4fdd62..b6ca975e4c 100644
--- a/lxd/main_checkfeature.go
+++ b/lxd/main_checkfeature.go
@@ -74,44 +74,44 @@ void is_netnsid_aware(int *hostnetns_fd, int *newnetns_fd)
 
 	*hostnetns_fd = open("/proc/self/ns/net", O_RDONLY | O_CLOEXEC);
 	if (*hostnetns_fd < 0) {
-		(void)sprintf(errbuf, "%s", "Failed to preserve host network namespace\n");
+		(void)sprintf(errbuf, "%s", "Failed to preserve host network namespace");
 		return;
 	}
 
 	ret = unshare(CLONE_NEWNET);
 	if (ret < 0) {
-		(void)sprintf(errbuf, "%s", "Failed to unshare network namespace\n");
+		(void)sprintf(errbuf, "%s", "Failed to unshare network namespace");
 		return;
 	}
 
 	*newnetns_fd = open("/proc/self/ns/net", O_RDONLY | O_CLOEXEC);
 	if (*newnetns_fd < 0) {
-		(void)sprintf(errbuf, "%s", "Failed to preserve new network namespace\n");
+		(void)sprintf(errbuf, "%s", "Failed to preserve new network namespace");
 		return;
 	}
 
 	ret = netns_set_nsid(*hostnetns_fd);
 	if (ret < 0) {
-		(void)sprintf(errbuf, "%s", "failed to set network namespace identifier\n");
+		(void)sprintf(errbuf, "%s", "failed to set network namespace identifier");
 		return;
 	}
 
 	netnsid = netns_get_nsid(*hostnetns_fd);
 	if (netnsid < 0) {
-		(void)sprintf(errbuf, "%s", "Failed to get network namespace identifier\n");
+		(void)sprintf(errbuf, "%s", "Failed to get network namespace identifier");
 		return;
 	}
 
 	sock_fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
 	if (sock_fd < 0) {
-		(void)sprintf(errbuf, "%s", "Failed to open netlink routing socket\n");
+		(void)sprintf(errbuf, "%s", "Failed to open netlink routing socket");
 		return;
 	}
 
 	ret = setsockopt(sock_fd, SOL_NETLINK, NETLINK_DUMP_STRICT_CHK, &(int){1}, sizeof(int));
 	close(sock_fd);
 	if (ret < 0) {
-		(void)sprintf(errbuf, "%s", "Failed to set NETLINK_DUMP_STRICT_CHK socket option\n");
+		(void)sprintf(errbuf, "%s", "Failed to set NETLINK_DUMP_STRICT_CHK socket option");
 		return;
 	}
 	netnsid_aware = true;
@@ -132,7 +132,7 @@ void checkfeature() {
 	is_uevent_aware();
 
 	if (setns(hostnetns_fd, CLONE_NEWNET) < 0)
-		(void)sprintf(errbuf, "%s", "Failed to attach to host network namespace\n");
+		(void)sprintf(errbuf, "%s", "Failed to attach to host network namespace");
 
 	if (hostnetns_fd >= 0)
 		close(hostnetns_fd);


More information about the lxc-devel mailing list