mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 22:50:21 +02:00
* fallback to fputime if fputimensat fails as not being available
git-svn-id: trunk@48474 -
(cherry picked from commit c3656c6b1c
)
This commit is contained in:
parent
5ea32418d8
commit
b2da1dbfba
@ -1160,9 +1160,8 @@ var
|
||||
SystemFileName: RawByteString;
|
||||
{$ifdef USE_UTIMENSAT}
|
||||
times : tkernel_timespecs;
|
||||
{$else USE_UTIMENSAT}
|
||||
t: TUTimBuf;
|
||||
{$endif USE_UTIMENSAT}
|
||||
t: TUTimBuf;
|
||||
begin
|
||||
SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
|
||||
Result:=0;
|
||||
@ -1173,12 +1172,15 @@ begin
|
||||
times[1].tv_nsec:=0;
|
||||
if fputimensat(AT_FDCWD,PChar(SystemFileName),times,0) = -1 then
|
||||
Result:=fpgeterrno;
|
||||
{$else USE_UTIMENSAT}
|
||||
t.actime:= Age;
|
||||
t.modtime:=Age;
|
||||
if fputime(PChar(SystemFileName), @t) = -1 then
|
||||
Result:=fpgeterrno;
|
||||
if fpgeterrno=ESysENOSYS then
|
||||
{$endif USE_UTIMENSAT}
|
||||
begin
|
||||
Result:=0;
|
||||
t.actime:= Age;
|
||||
t.modtime:=Age;
|
||||
if fputime(PChar(SystemFileName), @t) = -1 then
|
||||
Result:=fpgeterrno;
|
||||
end
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user