Skip to content

Commit cc50f0d

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 ef30d8a + 636a926 commit cc50f0d

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

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

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

839839
errno = orig;
840-
} else if (orig == EINVAL)
840+
} else if (orig == EINVAL || errno == EBADF)
841841
errno = EPIPE;
842842
else {
843843
DWORD buf_size;

0 commit comments

Comments
 (0)