Skip to content

Commit

Permalink
Additional error checks for issuing the windows.appendAtomically warn…
Browse files Browse the repository at this point in the history
…ing (#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 <dl3@pale-eds.co.uk>
  • Loading branch information
dscho committed Aug 7, 2023
2 parents 7d048b1 + d3ad54f commit 62049bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/mingw.c
Expand Up @@ -948,7 +948,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
{
ssize_t result = write(fd, buf, len);

if (result < 0 && errno == EINVAL && buf) {
if (result < 0 && (errno == EINVAL || errno == EBADF) && buf) {
/* check if fd is a pipe */
HANDLE h = (HANDLE) _get_osfhandle(fd);
if (GetFileType(h) == FILE_TYPE_PIPE)
Expand Down

0 comments on commit 62049bc

Please sign in to comment.