aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/os/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/os/path.go')
-rw-r--r--libgo/go/os/path.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/go/os/path.go b/libgo/go/os/path.go
index 146d7b6..17c49c8 100644
--- a/libgo/go/os/path.go
+++ b/libgo/go/os/path.go
@@ -6,6 +6,7 @@ package os
import (
"io"
+ "runtime"
"syscall"
)
@@ -97,6 +98,11 @@ func RemoveAll(path string) error {
// Remove contents & return first error.
err = nil
for {
+ if err == nil && (runtime.GOOS == "plan9" || runtime.GOOS == "nacl") {
+ // Reset read offset after removing directory entries.
+ // See golang.org/issue/22572.
+ fd.Seek(0, 0)
+ }
names, err1 := fd.Readdirnames(100)
for _, name := range names {
err1 := RemoveAll(path + string(PathSeparator) + name)