From ed7f53e0fa7c3ff7579b17c6d7ccccd5c0ef4eef Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Mon, 17 Jul 2006 13:34:00 -0400
Subject: [PATCH] BUG: When handing the child stdin pipe a file, allow another
 process to be writing to the file at the same time.  This allows children
 such as tail -f to function properly.

---
 ProcessWin32.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ProcessWin32.c b/ProcessWin32.c
index e1a53a0f..491b2899 100644
--- a/ProcessWin32.c
+++ b/ProcessWin32.c
@@ -1593,8 +1593,9 @@ int kwsysProcessCreate(kwsysProcess* cp, int index,
   else if(cp->PipeFileSTDIN)
     {
     /* Create a handle to read a file for stdin.  */
-    HANDLE fin = CreateFile(cp->PipeFileSTDIN, GENERIC_READ,
-                            FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+    HANDLE fin = CreateFile(cp->PipeFileSTDIN, GENERIC_READ|GENERIC_WRITE,
+                            FILE_SHARE_READ|FILE_SHARE_WRITE,
+                            0, OPEN_EXISTING, 0, 0);
     if(fin == INVALID_HANDLE_VALUE)
       {
       return 0;
-- 
GitLab