Eliminate some flakes

- Get ASAN working on Windows.

- Deleting directories and then recreating them with the same name in a
  short period of time appears to be a no-no on Windows.

- There's no reason to call FlushFileBuffers on close() for pipes, and
  it's harmful since it might block indefinitely for no good reason.
This commit is contained in:
Justine Tunney 2021-02-03 06:22:51 -08:00
parent 27c899af56
commit 4e56d89dcd
60 changed files with 588 additions and 751 deletions

View file

@ -112,11 +112,16 @@ static textwindows ssize_t open$nt$file(int dirfd, const char *file,
textwindows ssize_t open$nt(int dirfd, const char *file, uint32_t flags,
int32_t mode) {
size_t fd;
if ((fd = __getemptyfd()) == -1) return -1;
int fd;
ssize_t rc;
if ((fd = __reservefd()) == -1) return -1;
if ((flags & O_ACCMODE) == O_RDWR && !strcmp(file, kNtMagicPaths.devtty)) {
return open$nt$console(dirfd, &kNtMagicPaths, flags, mode, fd);
rc = open$nt$console(dirfd, &kNtMagicPaths, flags, mode, fd);
} else {
return open$nt$file(dirfd, file, flags, mode, fd);
rc = open$nt$file(dirfd, file, flags, mode, fd);
}
if (rc == -1) {
__releasefd(fd);
}
return rc;
}