Browse Source

* revert previous AssignPipe change, will need different approach

git-svn-id: trunk@12002 -
Almindor 17 years ago
parent
commit
bf9358efd4
1 changed files with 16 additions and 7 deletions
  1. 16 7
      rtl/freebsd/unxfunc.inc

+ 16 - 7
rtl/freebsd/unxfunc.inc

@@ -48,14 +48,23 @@ Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_
   If the operation was unsuccesful, linuxerror is set.
 }
 var
-  pip  : tpipe;
-begin
+  ret  : longint;
+  errn : cint;
   {$ifdef FPC_USE_LIBC}
-  assignpipe:=pipe(pip);
-  {$else}
-  assignPipe:=fppipe(pip);
+   fdis : array[0..1] of cint;
   {$endif}
-  pipe_in:=pip[0];
-  pipe_out:=pip[1];
+begin
+{$ifndef FPC_USE_LIBC}
+ ret:=intAssignPipe(pipe_in,pipe_out,errn);
+ if ret=-1 Then
+  fpseterrno(errn);
+{$ELSE}
+ fdis[0]:=pipe_in;
+ fdis[1]:=pipe_out;
+ ret:=pipe(fdis);
+ pipe_in:=fdis[0];
+ pipe_out:=fdis[1];
+{$ENDIF}
+ AssignPipe:=ret;
 end;