Skip to content

Commit

Permalink
Additional error checks for issuing the windows.appendAtomically warning
Browse files Browse the repository at this point in the history
Signed-off-by: David Lomas <[email protected]>
  • Loading branch information
David Lomas committed Jul 28, 2023
1 parent 4a1821d commit 41f0945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/mingw.c
Original file line number Diff line number Diff line change
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 41f0945

Please sign in to comment.