Skip to content

Commit d3ad54f

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 7d048b1 commit d3ad54f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
948948
{
949949
ssize_t result = write(fd, buf, len);
950950

951-
if (result < 0 && errno == EINVAL && buf) {
951+
if (result < 0 && (errno == EINVAL || errno == EBADF) && buf) {
952952
/* check if fd is a pipe */
953953
HANDLE h = (HANDLE) _get_osfhandle(fd);
954954
if (GetFileType(h) == FILE_TYPE_PIPE)

0 commit comments

Comments
 (0)