git/list[1] front-page[2] threads[3] people[4] search[5] about
 

PATCH] mingw: Fix a typo in the pipe() implementation.

From
RLRalph Loader <suckfish@ihug.co.nz>
Date
Oct 9, 2014, 08:03 UTC
Message-ID
<20141009210359.57a0bdab1f8f8700dc206e76@ihug.co.nz>

We checked the first file descriptor for errors twice, instead of checking both file descriptors.

Signed-off-by: Ralph Loader <rcl@ihug.co.nz>
---
While this appears utterly trivial, I noticed this reading the code not
running it - I do not have the relevant OS to compile and test on.
 compat/mingw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index c5c37e5..7c92783 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;
-- 
2.1.0
Message 1 of 1 in “PATCH] mingw: Fix a typo in the pipe() implementation.”
  1. Ralph LoaderOct 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.