瀏覽代碼

* fixed ambiguity between pipe(2) with two params and pipe(3) with one that broke -dFPC_USE_LIBC

(cherry picked from commit f341baeaa783fff4b50cec8757e3b7a85837bfd7)
marcoonthegit 2 年之前
父節點
當前提交
3a399845e4
共有 3 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      rtl/freebsd/unxfunc.inc
  2. 1 0
      rtl/unix/baseunix.pp
  3. 1 1
      rtl/unix/bunxh.inc

+ 1 - 1
rtl/freebsd/unxfunc.inc

@@ -51,7 +51,7 @@ var
   pip  : tfildes;
   flags : cint;
 begin
-  assignPipe:=fppipe(pip, 0);
+  assignPipe:=fppipe(pip); // default parameter adds 0, if necessary. This abstracts between pipe(2) and pipe(3)
   pipe_in:=pip[0];
   pipe_out:=pip[1];
 end;

+ 1 - 0
rtl/unix/baseunix.pp

@@ -13,6 +13,7 @@
 
  **********************************************************************}
 Unit BaseUnix;
+{$modeswitch defaultparameters} // on freebsd to make one (libc) and two parameter pipe transparent.
 
 Interface
 {$modeswitch out}

+ 1 - 1
rtl/unix/bunxh.inc

@@ -35,7 +35,7 @@ Type TGrpArr = Array [0..0] of TGid;            { C style array workarounds}
     Function  FpChown      (path : pChar; owner : TUid; group : TGid): cInt;
     Function  FpUtime      (path : pChar; times : putimbuf): cInt;
 {$if defined(freebsd)}
-    Function  FpPipe       (var fildes : tfildes; flags : cInt):cInt;
+    Function  FpPipe       (var fildes : tfildes; flags : cInt=0):cInt;
 {$else}
     Function  FpPipe       (var fildes : tfildes):cInt;
 {$endif}