Skip to content

Commit e21e749

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 <dl3@pale-eds.co.uk> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent d62d906 commit e21e749

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compat/mingw.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
787787
{
788788
ssize_t result = write(fd, buf, len);
789789

790-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
790+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
791791
int orig = errno;
792792

793793
/* check if fd is a pipe */
@@ -813,7 +813,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
813813
}
814814

815815
errno = orig;
816-
} else if (orig == EINVAL)
816+
} else if (orig == EINVAL || errno == EBADF)
817817
errno = EPIPE;
818818
else {
819819
DWORD buf_size;

0 commit comments

Comments
 (0)