Skip to content

Commit 4fe0e15

Browse files
dsl101Git for Windows Build Agent
authored andcommitted
mingw: suggest windows.appendAtomically in more cases
When running Git for Windows on a remote APFS filesystem, it would appear that the `mingw_open_append()`/`write()` combination would fail almost exactly like on some CIFS-mounted shares as had been reported in #2753, albeit with a different `errno` value. Let's handle that `errno` value just the same, by suggesting to set `windows.appendAtomically=false`. Signed-off-by: David Lomas <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0399921 commit 4fe0e15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compat/mingw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
790790
{
791791
ssize_t result = write(fd, buf, len);
792792

793-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
793+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
794794
int orig = errno;
795795

796796
/* check if fd is a pipe */
@@ -816,7 +816,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
816816
}
817817

818818
errno = orig;
819-
} else if (orig == EINVAL)
819+
} else if (orig == EINVAL || errno == EBADF)
820820
errno = EPIPE;
821821
else {
822822
DWORD buf_size;

0 commit comments

Comments
 (0)