From 25a9843ea4488a7fcd462ba7a20964c20933e96f Mon Sep 17 00:00:00 2001 From: nickysn Date: Wed, 23 Jun 2021 20:57:50 +0000 Subject: [PATCH] * also set doserror to 5 for access denied in dos.getfattr git-svn-id: trunk@49538 - --- rtl/wasi/dos.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rtl/wasi/dos.pp b/rtl/wasi/dos.pp index 43621132f5..163b941ee4 100644 --- a/rtl/wasi/dos.pp +++ b/rtl/wasi/dos.pp @@ -658,14 +658,22 @@ end; Procedure getftime (var f; var time : longint); Var + res: __wasi_errno_t; Info: __wasi_filestat_t; DT: DateTime; Begin doserror:=0; - if __wasi_fd_filestat_get(filerec(f).handle,@Info)<>__WASI_ERRNO_SUCCESS then + res:=__wasi_fd_filestat_get(filerec(f).handle,@Info); + if res<>__WASI_ERRNO_SUCCESS then begin Time:=0; - doserror:=6; + case res of + __WASI_ERRNO_ACCES, + __WASI_ERRNO_NOTCAPABLE: + doserror:=5; + else + doserror:=6; + end; exit end else