From 7785471dd42a40fd7a6e516066a2cf84576a93c2 Mon Sep 17 00:00:00 2001 From: micha Date: Fri, 31 Mar 2006 21:29:36 +0000 Subject: [PATCH] fix handle type; close parent ends of pipes in child process git-svn-id: trunk@3099 - --- fcl/unix/process.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fcl/unix/process.inc b/fcl/unix/process.inc index 6d7bea0714..bfc53d3f75 100644 --- a/fcl/unix/process.inc +++ b/fcl/unix/process.inc @@ -196,7 +196,7 @@ end; Type TPipeEnd = (peRead,peWrite); - TPipePair = Array[TPipeEnd] of Integer; + TPipePair = Array[TPipeEnd] of cint; Procedure CreatePipes(Var HI,HO,HE : TPipePair; CE : Boolean); @@ -284,12 +284,17 @@ begin ChDir(FCurrentDirectory); if PoUsePipes in Options then begin + fpclose(HI[peWrite]); fpdup2(HI[peRead],0); + fpclose(HO[peRead]); fpdup2(HO[peWrite],1); if (poStdErrToOutPut in Options) then fpdup2(HO[peWrite],2) - else + else + begin + fpclose(HE[peRead]); fpdup2(HE[peWrite],2); + end end else if poNoConsole in Options then begin