Fix issues for latest GCC toolchain

This commit is contained in:
Justine Tunney 2023-10-11 14:54:42 -07:00
parent 5cb9b2658c
commit 3b086af91b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
22 changed files with 148 additions and 166 deletions

View file

@ -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) {