Skip to content

Commit 63bdf1c

Browse files
dsl101dscho
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 54bea87 commit 63bdf1c

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
@@ -718,7 +718,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
718718
{
719719
ssize_t result = write(fd, buf, len);
720720

721-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
721+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
722722
int orig = errno;
723723

724724
/* check if fd is a pipe */
@@ -744,7 +744,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
744744
}
745745

746746
errno = orig;
747-
} else if (orig == EINVAL)
747+
} else if (orig == EINVAL || errno == EBADF)
748748
errno = EPIPE;
749749
else {
750750
DWORD buf_size;

0 commit comments

Comments
 (0)