summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2021-04-16 11:21:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-16 19:05:32 (GMT)
commit9160068ac6ec52d119c97bf778c44787b93d81d1 (patch)
tree27234f7af23630c155fcbce4081349b889460ab2 /compat
parent48bf2fa8bad054d66bd79c6ba903c89c704201f7 (diff)
downloadgit-9160068ac6ec52d119c97bf778c44787b93d81d1.zip
git-9160068ac6ec52d119c97bf778c44787b93d81d1.tar.gz
git-9160068ac6ec52d119c97bf778c44787b93d81d1.tar.bz2
msvc: avoid calling `access("NUL", flags)`
Apparently this is not supported with Microsoft's Universal C Runtime. So let's not actually do that. Instead, just return success because we _know_ that we expect the `NUL` device to be present. Side note: it is possible to turn off the "Null device driver" and thereby disable `NUL`. Too many things are broken if this driver is disabled, therefore it is not worth bothering to try to detect its presence when `access()` is called. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index a435998..aa647b3 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -685,6 +685,8 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
int mingw_access(const char *filename, int mode)
{
wchar_t wfilename[MAX_PATH];
+ if (!strcmp("nul", filename) || !strcmp("/dev/null", filename))
+ return 0;
if (xutftowcs_path(wfilename, filename) < 0)
return -1;
/* X_OK is not supported by the MSVCRT version */