Skip to content

Commit

Permalink
Mingw: verify both ends of the pipe () call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jose F. Morales authored and Junio C Hamano committed Aug 28, 2015
1 parent 52f6893 commit c3cb7b6
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 @@ -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;
Expand Down

0 comments on commit c3cb7b6

Please sign in to comment.