From 7cff8489de2254cf355ec81cebc2338e0035f2df Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Thu, 10 May 2018 17:12:21 -0700 Subject: Fix failure to rename directory os.Rename validates that the target doesn't exist, which is different from syscall.Rename which replace the target if both are directories. fsgofer needs the syscall behavior. PiperOrigin-RevId: 196194630 Change-Id: I87d08cad88b5ef310b245cd91647c4f5194159d8 --- runsc/fsgofer/fsgofer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runsc/fsgofer') diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go index 11dd28cef..cd6224de3 100644 --- a/runsc/fsgofer/fsgofer.go +++ b/runsc/fsgofer/fsgofer.go @@ -708,7 +708,7 @@ func (l *localFile) Rename(directory p9.File, name string) error { // TODO: change to renameat(2) parent := directory.(*localFile) newPath := path.Join(parent.hostPath, name) - if err := os.Rename(l.hostPath, newPath); err != nil { + if err := syscall.Rename(l.hostPath, newPath); err != nil { return extractErrno(err) } -- cgit v1.2.3