mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2026-02-13 14:41:45 +01:00
Fixed Error return value of ... is not checked (errcheck)
This commit is contained in:
@@ -230,7 +230,9 @@ func (m *LikwidCollector) Init(config json.RawMessage) error {
|
|||||||
|
|
||||||
if m.config.ForceOverwrite {
|
if m.config.ForceOverwrite {
|
||||||
cclog.ComponentDebug(m.name, "Set LIKWID_FORCE=1")
|
cclog.ComponentDebug(m.name, "Set LIKWID_FORCE=1")
|
||||||
os.Setenv("LIKWID_FORCE", "1")
|
if err := os.Setenv("LIKWID_FORCE", "1"); err != nil {
|
||||||
|
return fmt.Errorf("error setting environment variable LIKWID_FORCE=1: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m.setup()
|
m.setup()
|
||||||
|
|
||||||
@@ -316,7 +318,14 @@ func (m *LikwidCollector) Init(config json.RawMessage) error {
|
|||||||
case "accessdaemon":
|
case "accessdaemon":
|
||||||
if len(m.config.DaemonPath) > 0 {
|
if len(m.config.DaemonPath) > 0 {
|
||||||
p := os.Getenv("PATH")
|
p := os.Getenv("PATH")
|
||||||
os.Setenv("PATH", m.config.DaemonPath+":"+p)
|
if len(p) > 0 {
|
||||||
|
p = m.config.DaemonPath + ":" + p
|
||||||
|
} else {
|
||||||
|
p = m.config.DaemonPath
|
||||||
|
}
|
||||||
|
if err := os.Setenv("PATH", p); err != nil {
|
||||||
|
return fmt.Errorf("error setting environment variable PATH=%s: %v", p, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
C.HPMmode(1)
|
C.HPMmode(1)
|
||||||
retCode := C.HPMinit()
|
retCode := C.HPMinit()
|
||||||
|
|||||||
Reference in New Issue
Block a user