Commit 9997dae7 authored by Alex Brainman's avatar Alex Brainman

os: make RemoveAll() work on windows

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/2212041
parent 7534d40f
...@@ -84,7 +84,6 @@ func RemoveAll(path string) Error { ...@@ -84,7 +84,6 @@ func RemoveAll(path string) Error {
if err != nil { if err != nil {
return err return err
} }
defer fd.Close()
// Remove contents & return first error. // Remove contents & return first error.
err = nil err = nil
...@@ -105,6 +104,9 @@ func RemoveAll(path string) Error { ...@@ -105,6 +104,9 @@ func RemoveAll(path string) Error {
} }
} }
// Close directory, because windows won't remove opened directory.
fd.Close()
// Remove directory. // Remove directory.
err1 := Remove(path) err1 := Remove(path)
if err == nil { if err == nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment