mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-11 21:49:12 +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
|
@ -25,8 +25,9 @@ textwindows int chdir$nt(const char *path) {
|
|||
int len;
|
||||
char16_t path16[PATH_MAX];
|
||||
if ((len = __mkntpath(path, path16)) == -1) return -1;
|
||||
if (path16[len - 1] != u'/' && path16[len - 1] != u'\\') {
|
||||
path16[len + 0] = u'/';
|
||||
if (path16[len - 1] != u'\\') {
|
||||
if (len + 1 + 1 > PATH_MAX) return enametoolong();
|
||||
path16[len + 0] = u'\\';
|
||||
path16[len + 1] = u'\0';
|
||||
}
|
||||
if (SetCurrentDirectory(path16)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue