[lxc-devel] [lxc/master] lxc_init: s/SYSDEBUG()/SYSERROR()/g in remove_self

brauner on Github lxc-bot at linuxcontainers.org
Fri Aug 17 09:52:08 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 600 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180817/d3d29ae5/attachment.bin>
-------------- next part --------------
From 694756df3a768c4fd700b4a209f2ae6b4fa7bd7c Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Fri, 17 Aug 2018 11:47:25 +0200
Subject: [PATCH] lxc_init: s/SYSDEBUG()/SYSERROR()/g in remove_self

Since we switched to execveat() whenever possible in
commit 4b5b3a2a299b ("execute: use execveat() syscall if supported")
it is unlikely that remove_self() has any job to do at all. So dumb down the
error levels.

Closes #2536.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/cmd/lxc_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lxc/cmd/lxc_init.c b/src/lxc/cmd/lxc_init.c
index 7f47cbddb..17d93f80b 100644
--- a/src/lxc/cmd/lxc_init.c
+++ b/src/lxc/cmd/lxc_init.c
@@ -201,20 +201,20 @@ static void remove_self(void)
 
 	n = readlink("/proc/self/exe", path, sizeof(path));
 	if (n < 0 || n >= MAXPATHLEN) {
-		SYSERROR("Failed to readlink \"/proc/self/exe\"");
+		SYSDEBUG("Failed to readlink \"/proc/self/exe\"");
 		return;
 	}
 	path[n] = '\0';
 
 	ret = umount2(path, MNT_DETACH);
 	if (ret < 0) {
-		SYSERROR("Failed to unmount \"%s\"", path);
+		SYSDEBUG("Failed to unmount \"%s\"", path);
 		return;
 	}
 
 	ret = unlink(path);
 	if (ret < 0) {
-		SYSERROR("Failed to unlink \"%s\"", path);
+		SYSDEBUG("Failed to unlink \"%s\"", path);
 		return;
 	}
 }


More information about the lxc-devel mailing list