Browse Source

* fixed fpdup2() for non-text files

git-svn-id: trunk@1557 -
Jonas Maebe 20 years ago
parent
commit
5cd3f3272c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/unix/bunxovl.inc

+ 4 - 0
rtl/unix/bunxovl.inc

@@ -278,8 +278,12 @@ Function FpDup2(var oldfile,newfile:file):cint;
 {
 {
   Copies the filedescriptor oldfile to newfile
   Copies the filedescriptor oldfile to newfile
 }
 }
+var
+  tmphandle : word;
 begin
 begin
+  tmphandle := filerec(newfile).handle;
   filerec(newfile):=filerec(oldfile);
   filerec(newfile):=filerec(oldfile);
+  filerec(newfile).handle := tmphandle;
   fpDup2:=fpDup2(filerec(oldfile).handle,filerec(newfile).handle);
   fpDup2:=fpDup2(filerec(oldfile).handle,filerec(newfile).handle);
 end;
 end;