mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-17 08:00:32 +00:00
Add exponential backoff to rmdir() on Windows
This commit is contained in:
parent
bf8b1623c8
commit
eaca5b3e81
7 changed files with 38 additions and 16 deletions
|
@ -37,7 +37,12 @@ static int rmrfdir(const char *dirpath) {
|
|||
if (!strcmp(e->d_name, "..")) continue;
|
||||
if (strchr(e->d_name, '/')) abort();
|
||||
path = xjoinpaths(dirpath, e->d_name);
|
||||
if ((e->d_type == DT_DIR ? rmrfdir(path) : unlink(path)) == -1) {
|
||||
if (e->d_type == DT_DIR) {
|
||||
rc = rmrfdir(path);
|
||||
} else {
|
||||
rc = unlink(path);
|
||||
}
|
||||
if (rc == -1) {
|
||||
free(path);
|
||||
closedir(d);
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue