Browse Source

* handle loss fixed

pierre 26 years ago
parent
commit
a9dcc269c9
1 changed files with 19 additions and 2 deletions
  1. 19 2
      ide/text/fpredir.pas

+ 19 - 2
ide/text/fpredir.pas

@@ -109,7 +109,9 @@ var
 
 
 { For linux the following functions exist
 { For linux the following functions exist
 Function  Dup(oldfile:longint;var newfile:longint):Boolean;
 Function  Dup(oldfile:longint;var newfile:longint):Boolean;
-Function  Dup2(oldfile,newfile:longint):Boolean; }
+Function  Dup2(oldfile,newfile:longint):Boolean;
+Function  fdClose(fd:longint):boolean;
+}
 {$ifdef go32v2}
 {$ifdef go32v2}
 
 
 function dup(fh : longint;var nh : longint) : boolean;
 function dup(fh : longint;var nh : longint) : boolean;
@@ -143,6 +145,15 @@ begin
       Dup2:=false;
       Dup2:=false;
 end;
 end;
 
 
+Function FdClose (Handle : Longint) : boolean;
+var Regs: registers;
+begin
+  Regs.Eax := $3e00;
+  Regs.Ebx := Handle;
+  MsDos(Regs);
+  FdClose:=(Regs.Flags and fCarry)=0;
+end;
+
 {$endif def go32v2}
 {$endif def go32v2}
 
 
 {$I-}
 {$I-}
@@ -282,6 +293,7 @@ end;
     dup2(TempHOut,StdOutputHandle);
     dup2(TempHOut,StdOutputHandle);
 {$endif}
 {$endif}
     Close (FOUT);
     Close (FOUT);
+    fdClose(TempHOut);
     RedirChangedOut:=false;
     RedirChangedOut:=false;
   end;
   end;
 
 
@@ -298,6 +310,7 @@ end;
     dup2(TempHIn,StdInputHandle);
     dup2(TempHIn,StdInputHandle);
 {$endif}
 {$endif}
     Close (FIn);
     Close (FIn);
+    fdClose(TempHIn);
     RedirChangedIn:=false;
     RedirChangedIn:=false;
   end;
   end;
 
 
@@ -314,6 +327,7 @@ end;
     dup2(TempHError,StdErrorHandle);
     dup2(TempHError,StdErrorHandle);
 {$endif}
 {$endif}
     Close (FERR);
     Close (FERR);
+    fdClose(TempHError);
     RedirChangedError:=false;
     RedirChangedError:=false;
   end;
   end;
 
 
@@ -413,7 +427,10 @@ end;
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1999-03-09 01:34:35  peter
+  Revision 1.14  1999-03-20 00:04:49  pierre
+   * handle loss fixed
+
+  Revision 1.13  1999/03/09 01:34:35  peter
     * linux unit
     * linux unit
 
 
   Revision 1.12  1999/03/08 14:58:10  peter
   Revision 1.12  1999/03/08 14:58:10  peter