From c9a02bf590248c0bd8e1343198d3f9c13ce118c1 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sat, 14 Jun 2008 18:34:02 +0200 Subject: Port to new ULibc unit, drop dependency to compiler Libc library (preparation for PPC port) --- UConfig.pas | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'UConfig.pas') diff --git a/UConfig.pas b/UConfig.pas index e295e2d..4dd13aa 100644 --- a/UConfig.pas +++ b/UConfig.pas @@ -130,14 +130,14 @@ function CheckConfFilesMod(var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, C implementation -uses Libc, SysUtils, IniFiles, UCoreUtils, UCore, UFileAssoc, UCoreClasses, UGnome, UVFSCore; +uses ULibc, SysUtils, UCoreUtils, UCore, UFileAssoc, UCoreClasses, UGnome, UVFSCore; var InternalQuickExit, InternalDeleteHistory: boolean; InternalMainGUIConfmtime, InternalBookmarksConfmtime, InternalFAssocConfmtime, InternalMounterConfmtime, InternalConnMgrConfmtime: Longint; -function GetFileTime(FileName: string): Longint; forward; +function GetFileTime(FileName: string): time_t; forward; (********************************************************************************************************************************) (********************************************************************************************************************************) @@ -652,7 +652,7 @@ begin Exit; end; s := IncludeTrailingPathDelimiter(s) + 'filetypes'; - if Libc.access(PChar(s), R_OK) = 0 then Libc.remove(PChar(s)); + if access(PChar(s), R_OK) = 0 then libc_remove(PChar(s)); IniFile := TMyIniFile.Create(s, False); try try @@ -786,7 +786,7 @@ begin Exit; end; s := IncludeTrailingPathDelimiter(s) + 'mounter'; - if Libc.access(PChar(s), R_OK) = 0 then Libc.remove(PChar(s)); + if access(PChar(s), R_OK) = 0 then libc_remove(PChar(s)); IniFile := TMyIniFile.Create(s, False); try try @@ -959,7 +959,7 @@ begin Exit; end; s := IncludeTrailingPathDelimiter(s) + 'connmgr'; - if Libc.access(PChar(s), R_OK) = 0 then Libc.remove(PChar(s)); + if access(PChar(s), R_OK) = 0 then libc_remove(PChar(s)); IniFile := TMyIniFile.Create(s, False); try try @@ -1016,12 +1016,14 @@ end; (********************************************************************************************************************************) (********************************************************************************************************************************) -function GetFileTime(FileName: string): Longint; -var StatBuf : TStatBuf64; +function GetFileTime(FileName: string): time_t; +var StatBuf: Pstat64; begin Result := -1; - if __lxstat64(_STAT_VER, PChar(FileName), StatBuf) <> 0 then Exit; - Result := StatBuf.st_mtime; + StatBuf := malloc(sizeof(Tstat64)); + memset(StatBuf, 0, sizeof(Tstat64)); + if lstat64(PChar(FileName), StatBuf) = 0 then Result := StatBuf^.st_mtim.tv_sec; + libc_free(StatBuf); end; function CheckConfFilesMod(var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, ChangedMounter, ChangedConnections: boolean): boolean; -- cgit v1.2.3