Skip to content

Commit 75a6ee1

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Additional error checks for issuing the windows.appendAtomically warning (#4528)
Another (hopefully clean) PR for showing the error warning about atomic append on windows after failure on APFS, which returns EBADF not EINVAL. Signed-off-by: David Lomas <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
2 parents b6df12a + 8b91bcd commit 75a6ee1

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
@@ -812,7 +812,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
812812
{
813813
ssize_t result = write(fd, buf, len);
814814

815-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
815+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
816816
int orig = errno;
817817

818818
/* check if fd is a pipe */
@@ -838,7 +838,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
838838
}
839839

840840
errno = orig;
841-
} else if (orig == EINVAL)
841+
} else if (orig == EINVAL || errno == EBADF)
842842
errno = EPIPE;
843843
else {
844844
DWORD buf_size;

0 commit comments

Comments
 (0)