Skip to content

Commit 3635a3e

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 3a38791 + 7fd0602 commit 3635a3e

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
@@ -828,7 +828,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
828828
{
829829
ssize_t result = write(fd, buf, len);
830830

831-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
831+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
832832
int orig = errno;
833833

834834
/* check if fd is a pipe */
@@ -854,7 +854,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
854854
}
855855

856856
errno = orig;
857-
} else if (orig == EINVAL)
857+
} else if (orig == EINVAL || errno == EBADF)
858858
errno = EPIPE;
859859
else {
860860
DWORD buf_size;

0 commit comments

Comments
 (0)