Skip to content

Commit b25d2e8

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 1b01c2f + f229a85 commit b25d2e8

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

817-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
817+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
818818
int orig = errno;
819819

820820
/* check if fd is a pipe */
@@ -840,7 +840,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
840840
}
841841

842842
errno = orig;
843-
} else if (orig == EINVAL)
843+
} else if (orig == EINVAL || errno == EBADF)
844844
errno = EPIPE;
845845
else {
846846
DWORD buf_size;

0 commit comments

Comments
 (0)