mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #4840 from marquiz/devel/rdt-mkdir-rmdir
libcontainer/intelrdt: use Mkdir/Remove instead of MkdirAll/RemoveAll
This commit is contained in:
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user