mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Fix issues for latest GCC toolchain
This commit is contained in:
parent
5cb9b2658c
commit
3b086af91b
22 changed files with 148 additions and 166 deletions
|
@ -55,8 +55,7 @@ static textwindows bool IsDirectorySymlink(const char16_t *path) {
|
|||
}
|
||||
|
||||
static textwindows int sys_rmdir_nt(const char16_t *path) {
|
||||
int e, ms;
|
||||
e = errno;
|
||||
int ms;
|
||||
for (ms = 1;; ms *= 2) {
|
||||
if (RemoveDirectory(path)) {
|
||||
return 0;
|
||||
|
@ -67,14 +66,13 @@ static textwindows int sys_rmdir_nt(const char16_t *path) {
|
|||
// Alternative is use Microsoft internal APIs.
|
||||
// Never could have imagined it'd be this bad.
|
||||
if (GetLastError() == kNtErrorDirNotEmpty && ms <= 2048) {
|
||||
errno = e;
|
||||
Sleep(ms);
|
||||
continue;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return __winerr();
|
||||
}
|
||||
|
||||
static textwindows int sys_unlink_nt(const char16_t *path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue