Skip to content

Commit fe68524

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 a22266c + 2b9fb57 commit fe68524

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
@@ -721,7 +721,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
721721
{
722722
ssize_t result = write(fd, buf, len);
723723

724-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
724+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
725725
int orig = errno;
726726

727727
/* check if fd is a pipe */
@@ -747,7 +747,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
747747
}
748748

749749
errno = orig;
750-
} else if (orig == EINVAL)
750+
} else if (orig == EINVAL || errno == EBADF)
751751
errno = EPIPE;
752752
else {
753753
DWORD buf_size;

0 commit comments

Comments
 (0)