mirror of
https://github.com/git-for-windows/git.git
synced 2026-02-03 18:59:59 -06:00
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 <dl3@pale-eds.co.uk> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
This commit is contained in:
commit
26127c0d42
@ -971,7 +971,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 || errno == ENOSPC) && buf) {
|
||||
if (result < 0 && (errno == EINVAL || errno == EBADF || errno == ENOSPC) && buf) {
|
||||
int orig = errno;
|
||||
|
||||
/* check if fd is a pipe */
|
||||
@ -997,7 +997,7 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
|
||||
}
|
||||
|
||||
errno = orig;
|
||||
} else if (orig == EINVAL)
|
||||
} else if (orig == EINVAL || errno == EBADF)
|
||||
errno = EPIPE;
|
||||
else {
|
||||
DWORD buf_size;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user