fs.Dir.deleteTree: Fix DirNotEmpty condition

`deleteTree` needs to retry once the directory is reported to be not
empty. Otherwise, the retry condition is never reached.
This commit is contained in:
xEgoist 2023-04-22 06:26:42 -05:00 committed by Veikka Tuominen
parent 23c4f55a61
commit ce3fe72d9a

View File

@ -2210,7 +2210,7 @@ pub const Dir = struct {
var need_to_retry: bool = false;
parent_dir.deleteDir(name) catch |err| switch (err) {
error.FileNotFound => {},
error.DirNotEmpty => need_to_retry = false,
error.DirNotEmpty => need_to_retry = true,
else => |e| return e,
};