[lxc-devel] [lxd/master] lxd: Check RemoveAll() error properly

monstermunchkin on Github lxc-bot at linuxcontainers.org
Mon Aug 12 10:06:03 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 355 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190812/33d2e18d/attachment.bin>
-------------- next part --------------
From 9d133505928ed0fcf7852b3c7ee2b4a9834c3e05 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Mon, 12 Aug 2019 12:04:39 +0200
Subject: [PATCH] lxd: Check RemoveAll() error properly

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 lxd/logging.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/logging.go b/lxd/logging.go
index 15b8ccf1f3..e46bad2509 100644
--- a/lxd/logging.go
+++ b/lxd/logging.go
@@ -115,7 +115,7 @@ func expireLogs(ctx context.Context, state *state.State) error {
 				if logfile.IsDir() {
 					newest := newestFile(path, logfile)
 					if time.Since(newest).Hours() >= 48 {
-						os.RemoveAll(path)
+						err := os.RemoveAll(path)
 						if err != nil {
 							return err
 						}


More information about the lxc-devel mailing list