Merge pull request #4840 from marquiz/devel/rdt-mkdir-rmdir

libcontainer/intelrdt: use Mkdir/Remove instead of MkdirAll/RemoveAll
This commit is contained in:
Rodrigo Campos
2025-08-07 09:49:54 -03:00
committed by GitHub
+2 -2
View File
@@ -472,7 +472,7 @@ func (m *Manager) Apply(pid int) (err error) {
}
}
if err := os.MkdirAll(path, 0o755); err != nil {
if err := os.Mkdir(path, 0o755); err != nil && !os.IsExist(err) {
return newLastCmdError(err)
}
@@ -492,7 +492,7 @@ func (m *Manager) Destroy() error {
if m.config.IntelRdt != nil && m.config.IntelRdt.ClosID == "" {
m.mu.Lock()
defer m.mu.Unlock()
if err := os.RemoveAll(m.GetPath()); err != nil {
if err := os.Remove(m.GetPath()); err != nil && !os.IsNotExist(err) {
return err
}
m.path = ""