[PATCH v2] Mingw: verify both ends of the pipe () call
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 28, 2015, 09:43 UTC
- Message-ID
- <0000014f73b0e4ef-12b105a6-5f9c-4131-956f-97a1bd85e072-000000@eu-west-1.amazonses.com>
- In-Reply-To
- <0000014f6fdf5839-19f5bc24-80bf-4b9e-a26b-2ef089a28f06-000000@eu-west-1.amazonses.com>
From: Jose F. Morales <jfmcjf@gmail.com>
The code to open and test the second end of the pipe clearly imitates the code for the first end. A little too closely, though... Let's fix the obvious copy-edit bug.
Signed-off-by: Jose F. Morales <jfmcjf@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- compat/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/mingw.c b/compat/mingw.c index 496e6f8..f74da23 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -681,7 +681,7 @@ int pipe(int filedes[2]) return -1; } filedes[1] = _open_osfhandle((int)h[1], O_NOINHERIT); - if (filedes[0] < 0) { + if (filedes[1] < 0) { close(filedes[0]); CloseHandle(h[1]); return -1; -- https://github.com/git/git/pull/168