diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-06-14 18:34:02 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-06-14 18:34:02 +0200 |
| commit | c9a02bf590248c0bd8e1343198d3f9c13ce118c1 (patch) | |
| tree | cbd1b07cea6f3ccea7fc98c58d65f568e69e8527 /UConfig.pas | |
| parent | b1dfa430702770c83c815bec24f1dc72175e1e5e (diff) | |
| download | tuxcmd-0.6.43.tar.xz | |
Port to new ULibc unit, drop dependency to compiler Libc libraryv0.6.43
(preparation for PPC port)
Diffstat (limited to 'UConfig.pas')
| -rw-r--r-- | UConfig.pas | 20 |
1 files changed, 11 insertions, 9 deletions
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; |
