Skip to content

Commit 008a868

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 bddecdd + f4353fa commit 008a868

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
@@ -791,7 +791,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
791791
{
792792
ssize_t result = write(fd, buf, len);
793793

794-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
794+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
795795
int orig = errno;
796796

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

819819
errno = orig;
820-
} else if (orig == EINVAL)
820+
} else if (orig == EINVAL || errno == EBADF)
821821
errno = EPIPE;
822822
else {
823823
DWORD buf_size;

0 commit comments

Comments
 (0)