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>

Johannes Schindelin committed Apr 16, 2021 at 13:21 UTC 9160068ac6ec52d119c97bf778c44787b93d81d1
1 file changed +2
compat/mingw.c
+2
@@ -685,6 +685,8 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
685 int mingw_access(const char *filename, int mode)
686 {
687 wchar_t wfilename[MAX_PATH];
688 + if (!strcmp("nul", filename) || !strcmp("/dev/null", filename))
689 + return 0;
690 if (xutftowcs_path(wfilename, filename) < 0)
691 return -1;
692 /* X_OK is not supported by the MSVCRT version */