[lxc-devel] [lxd/master] lxc/cgroup: Fix bad error handling

stgraber on Github lxc-bot at linuxcontainers.org
Thu Dec 12 20:20:55 UTC 2019


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/20191212/260ef9ff/attachment.bin>
-------------- next part --------------
From 0757115f6a7bcd5cf5e9fdecf28930dff61728a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 12 Dec 2019 15:20:31 -0500
Subject: [PATCH] lxc/cgroup: Fix bad error handling
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/cgroup/init.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/cgroup/init.go b/lxd/cgroup/init.go
index 188cf480ad..97bf705bbf 100644
--- a/lxd/cgroup/init.go
+++ b/lxd/cgroup/init.go
@@ -116,7 +116,7 @@ func init() {
 			}
 
 			controllers, err = os.Open(dedicatedPath)
-			if !os.IsNotExist(err) {
+			if err != nil && !os.IsNotExist(err) {
 				logger.Errorf("Unable to load cgroup.controllers")
 				return
 			}


More information about the lxc-devel mailing list