From 7d7e33dc93f41d78a658f257cb00d9c2884a09ad Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Fri, 6 Mar 2020 09:56:31 +0100 Subject: [PATCH] Log error if pipe deletion fails Hopefully this helps to shed some light on #42. --- collector.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collector.go b/collector.go index 01e9f22..d12b309 100644 --- a/collector.go +++ b/collector.go @@ -234,7 +234,11 @@ func freeipmiOutput(cmd string, target ipmiTarget, arg ...string) ([]byte, error if err != nil { return nil, err } - defer os.Remove(pipe) + defer func() { + if err := os.Remove(pipe); err != nil { + log.Errorf("Error deleting named pipe: %s", err) + } + }() args := []string{"--config-file", pipe} if !targetIsLocal(target.host) {