瀏覽代碼

* removed an empty overloaded version of statfs that could be called recursively
and its use in sysutils. Fixes failure of tw1041 and tw9985 in last runs.

git-svn-id: trunk@21334 -

marco 13 年之前
父節點
當前提交
455d675c5a
共有 3 個文件被更改,包括 9 次插入17 次删除
  1. 5 5
      rtl/unix/sysutils.pp
  2. 2 9
      rtl/unix/unxovl.inc
  3. 2 3
      rtl/unix/unxovlh.inc

+ 5 - 5
rtl/unix/sysutils.pp

@@ -911,7 +911,7 @@ end;
 
 {
   The Diskfree and Disksize functions need a file on the specified drive, since this
-  is required for the statfs system call.
+  is required for the fpstatfs system call.
   These filenames are set in drivestr[0..26], and have been preset to :
    0 - '.'      (default drive - hence current dir is ok.)
    1 - '/fd0/.'  (floppy drive 1 - should be adapted to local system )
@@ -949,8 +949,8 @@ Function DiskFree(Drive: Byte): int64;
 var
   fs : tstatfs;
 Begin
-  if ((Drive in [Low(FixDriveStr)..High(FixDriveStr)]) and (not (fixdrivestr[Drive]=nil)) and (statfs(StrPas(fixdrivestr[drive]),fs)<>-1)) or
-     ((Drive <= High(drivestr)) and (not (drivestr[Drive]=nil)) and (statfs(StrPas(drivestr[drive]),fs)<>-1)) then
+  if ((Drive in [Low(FixDriveStr)..High(FixDriveStr)]) and (not (fixdrivestr[Drive]=nil)) and (fpstatfs(StrPas(fixdrivestr[drive]),@fs)<>-1)) or
+     ((Drive <= High(drivestr)) and (not (drivestr[Drive]=nil)) and (fpstatfs(StrPas(drivestr[drive]),@fs)<>-1)) then
    Diskfree:=int64(fs.bavail)*int64(fs.bsize)
   else
    Diskfree:=-1;
@@ -962,8 +962,8 @@ Function DiskSize(Drive: Byte): int64;
 var
   fs : tstatfs;
 Begin
-  if ((Drive in [Low(FixDriveStr)..High(FixDriveStr)]) and (not (fixdrivestr[Drive]=nil)) and (statfs(StrPas(fixdrivestr[drive]),fs)<>-1)) or
-     ((drive <= High(drivestr)) and (not (drivestr[Drive]=nil)) and (statfs(StrPas(drivestr[drive]),fs)<>-1)) then
+  if ((Drive in [Low(FixDriveStr)..High(FixDriveStr)]) and (not (fixdrivestr[Drive]=nil)) and (fpstatfs(StrPas(fixdrivestr[drive]),@fs)<>-1)) or
+     ((drive <= High(drivestr)) and (not (drivestr[Drive]=nil)) and (fpstatfs(StrPas(drivestr[drive]),@fs)<>-1)) then
    DiskSize:=int64(fs.blocks)*int64(fs.bsize)
   else
    DiskSize:=-1;

+ 2 - 9
rtl/unix/unxovl.inc

@@ -13,16 +13,9 @@
 
  **********************************************************************}
 
-Function StatFS(Path:ansistring;Var Info:Tstatfs):cint;
-
-{
-  Get all information on a fileSystem, and return it in Info.
-  Path is the name of a file/directory on the fileSystem you wish to
-  investigate.
-}
+Function fpStatFS(Path:ansistring;Info:PStatfs):cint;
 
 begin
-  statfs:=statfs(pchar(path),info);
+  fpstatfs:=fpstatfs(pchar(path),info);
 end;
 
-

+ 2 - 3
rtl/unix/unxovlh.inc

@@ -14,7 +14,6 @@
  ***********************************************************************}
 
 Function PClose(Var F:file) : cint;
-Function PClose      (Var F:text) : cint;
-Function StatFS(Path:ansistring;Var Info:Tstatfs):cint;
-//Function fpReadLink(Name:ansistring):ansistring;
+Function PClose(Var F:text) : cint;
+Function fpStatFS(Path:ansistring;Info:PStatfs):cint;