summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessWin32.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-07-17 17:34:00 (GMT)
committerBrad King <brad.king@kitware.com>2006-07-17 17:34:00 (GMT)
commit94bf03319bef3db92614d3e9b87a3efbcdd85a12 (patch)
treede36602eb2f2c1f1b72b2e9429fbc02e6804d250 /Source/kwsys/ProcessWin32.c
parent2bf97089baa220ec460ca6289f1e2ad4dd41e404 (diff)
downloadCMake-94bf03319bef3db92614d3e9b87a3efbcdd85a12.zip
CMake-94bf03319bef3db92614d3e9b87a3efbcdd85a12.tar.gz
CMake-94bf03319bef3db92614d3e9b87a3efbcdd85a12.tar.bz2
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.
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r--Source/kwsys/ProcessWin32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index 1e25edc..089c955 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/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;