aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/cleanup.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-02-24 17:13:12 -0800
committerColin Cross <ccross@android.com>2015-03-04 13:27:30 -0800
commit93ef72d2836ae001cca3b923ec68b9e691af9908 (patch)
tree9419fecabafcba1ce90175db5fefb4adf1989917 /bootstrap/cleanup.go
parent11e3b0d0006609e3835f4aa04f7cd7f6039239e8 (diff)
downloadandroid_build_blueprint-93ef72d2836ae001cca3b923ec68b9e691af9908.tar.gz
android_build_blueprint-93ef72d2836ae001cca3b923ec68b9e691af9908.tar.bz2
android_build_blueprint-93ef72d2836ae001cca3b923ec68b9e691af9908.zip
Don't fail cleanup when a file has turned into a directory
If .ninja_log contains an entry that used to be a file but is now a non-empty directory the os.Remove call will fail. Silently ignore this error, if the files in the directory are abandoned the directory will be cleaned up when the files are removed.
Diffstat (limited to 'bootstrap/cleanup.go')
-rw-r--r--bootstrap/cleanup.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/bootstrap/cleanup.go b/bootstrap/cleanup.go
index 7029111..f7b1cf9 100644
--- a/bootstrap/cleanup.go
+++ b/bootstrap/cleanup.go
@@ -124,6 +124,11 @@ func removeFileAndEmptyDirs(path string) error {
if os.IsNotExist(err) {
return nil
}
+ pathErr := err.(*os.PathError)
+ switch pathErr.Err {
+ case syscall.ENOTEMPTY, syscall.EEXIST:
+ return nil
+ }
return err
}