Skip to content

Commit 46ce80d

Browse files
dsl101Git for Windows Build Agent
authored and
Git for Windows Build Agent
committed
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 b5ab40c commit 46ce80d

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
@@ -705,7 +705,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
705705
{
706706
ssize_t result = write(fd, buf, len);
707707

708-
if (result < 0 && errno == EINVAL && buf) {
708+
if (result < 0 && (errno == EINVAL || errno == EBADF) && buf) {
709709
/* check if fd is a pipe */
710710
HANDLE h = (HANDLE) _get_osfhandle(fd);
711711
if (GetFileType(h) == FILE_TYPE_PIPE)

0 commit comments

Comments
 (0)