Mingw: verify both ends of the pipe () call
authorJose F. Morales <jfmcjf@gmail.com>
Fri, 28 Aug 2015 09:43:37 +0000 (09:43 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Aug 2015 18:11:50 +0000 (11:11 -0700)
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>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c
index 496e6f8bb0217c40450c61e88fbf1e08fdb3f704..f74da235f598d8b0346fac8b48c4155f55ae5b81 100644 (file)
@@ -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;