Browse Source

* fix AssignPipe for FreeBSD

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

+ 7 - 16
rtl/freebsd/unxfunc.inc

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