Re: [PATCH v2] mingw: emulate write(2) that fails with a EPIPE

2015-12-21 Thread Junio C Hamano
Johannes Sixt writes: >> +#undef write >> +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) { >> +/* check if fd is a pipe */ >> +HANDLE h =

Re: [PATCH v2] mingw: emulate write(2) that fails with a EPIPE

2015-12-18 Thread Johannes Schindelin
Hi Junio, On Thu, 17 Dec 2015, Junio C Hamano wrote: > PLEASE DON'T DO THE BELOW TO THE SAME MESSAGE AS THE PATCH ITSELF. > "git apply" would not read and understand the next line as a natural > language sentence for obvious reasons. > > Johannes Schindelin writes:

Re: [PATCH v2] mingw: emulate write(2) that fails with a EPIPE

2015-12-18 Thread Johannes Sixt
Am 17.12.2015 um 18:08 schrieb Johannes Schindelin: On Windows, when writing to a pipe fails, errno is always EINVAL. However, Git expects it to be EPIPE. According to the documentation, there are two cases in which write() triggers EINVAL: the buffer is NULL, or the length is odd but the mode

[PATCH v2] mingw: emulate write(2) that fails with a EPIPE

2015-12-17 Thread Johannes Schindelin
On Windows, when writing to a pipe fails, errno is always EINVAL. However, Git expects it to be EPIPE. According to the documentation, there are two cases in which write() triggers EINVAL: the buffer is NULL, or the length is odd but the mode is 16-bit Unicode (the broken pipe is not mentioned as

Re: [PATCH v2] mingw: emulate write(2) that fails with a EPIPE

2015-12-17 Thread Junio C Hamano
Johannes Schindelin writes: > On Windows, when writing to a pipe fails, errno is always > EINVAL. However, Git expects it to be EPIPE. > > According to the documentation, there are two cases in which write() > triggers EINVAL: the buffer is NULL, or the length is odd