Skip to content

Commit 97d6a3d

Browse files
committed
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 780a638 + 2f6d36e commit 97d6a3d

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
@@ -788,7 +788,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
788788
{
789789
ssize_t result = write(fd, buf, len);
790790

791-
if (result < 0 && (errno == EINVAL || errno == ENOSPC) && buf) {
791+
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
792792
int orig = errno;
793793

794794
/* check if fd is a pipe */
@@ -814,7 +814,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
814814
}
815815

816816
errno = orig;
817-
} else if (orig == EINVAL)
817+
} else if (orig == EINVAL || errno == EBADF)
818818
errno = EPIPE;
819819
else {
820820
DWORD buf_size;

0 commit comments

Comments
 (0)