Procházet zdrojové kódy

Merged revisions 3099 via svnmerge from
svn+ssh://svn.freepascal.org/FPC/svn/fpc/trunk

........
r3099 | micha | 2006-03-31 23:29:36 +0200 (vr, 31 mrt 2006) | 1 line

fix handle type; close parent ends of pipes in child process
........

git-svn-id: branches/fixes_2_0@3100 -

micha před 19 roky
rodič
revize
b3fbb4a56d
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      fcl/unix/process.inc

+ 7 - 2
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