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

@ -27,8 +27,6 @@
#include "libc/sysv/consts/at.h"
#include "libc/sysv/errfuns.h"
__msabi extern typeof(GetFileAttributes) *const __imp_GetFileAttributesW;
static int __mkntpathat_impl(int dirfd, const char *path, int flags,
char16_t file[hasatleast PATH_MAX]) {
char16_t dir[PATH_MAX];
@ -71,7 +69,7 @@ int __mkntpathat(int dirfd, const char *path, int flags,
if (len > 1 && !(len == 3 && file[1] == ':')) {
file[--len] = 0;
}
if ((fattr = __imp_GetFileAttributesW(file)) != -1u &&
if ((fattr = GetFileAttributes(file)) != -1u &&
!(fattr & kNtFileAttributeReparsePoint) &&
!(fattr & kNtFileAttributeDirectory)) {
return enotdir();