Ver Fonte

* linux: FileGetDate makes use of statx if needed

git-svn-id: trunk@48476 -
(cherry picked from commit 90ba89a1280b408cbc31d90e96a81eb34d41ac08)
florian há 4 anos atrás
pai
commit
934765fc0b
1 ficheiros alterados com 15 adições e 7 exclusões
  1. 15 7
      rtl/unix/sysutils.pp

+ 15 - 7
rtl/unix/sysutils.pp

@@ -1077,14 +1077,22 @@ End;
 
 
 Function FileGetDate (Handle : Longint) : Int64;
-
-Var Info : Stat;
-
+Var
+  Info : Stat;
+{$ifdef USE_STATX}
+  Infox : Statx;
+{$endif USE_STATX}
 begin
-  If (fpFStat(Handle,Info))<0 then
-    Result:=-1
-  else
-    Result:=Info.st_Mtime;
+  Result:=-1;
+{$ifdef USE_STATX}
+  if Fpstatx(Handle,nil,0,STATX_MTIME,Infox)=0 then
+    Result:=Infox.stx_Mtime.tv_sec
+  else if fpgeterrno=ESysENOSYS then
+{$endif USE_STATX}
+    begin
+      If fpFStat(Handle,Info)=0 then
+        Result:=Info.st_Mtime;
+    end;
 end;