This commit is contained in:
red-prig 2022-11-13 17:43:00 +03:00
parent 40b2c39b5c
commit 3cff1f6249
2 changed files with 24 additions and 6 deletions

View File

@ -548,8 +548,15 @@ begin
Result:=_sys_getdirentries(fd,buf,nbytes,basep);
_sig_unlock;
_set_errno(Result);
Result:=px2sce(Result);
if (Result<0) then
begin
Result:=-Result;
_set_errno(Result);
Result:=px2sce(Result);
end else
begin
_set_errno(0);
end;
end;
function ps4_sceKernelGetdents(fd:Integer;buf:Pointer;nbytes:Int64):Int64; SysV_ABI_CDecl;
@ -558,8 +565,15 @@ begin
Result:=_sys_getdirentries(fd,buf,nbytes,nil);
_sig_unlock;
_set_errno(Result);
Result:=px2sce(Result);
if (Result<0) then
begin
Result:=-Result;
_set_errno(Result);
Result:=px2sce(Result);
end else
begin
_set_errno(0);
end;
end;
function _sys_stat(path:PChar;stat:PSceKernelStat):Integer;

View File

@ -153,7 +153,9 @@ begin
if FindNextFileW(h,data) then
begin
tmp:=Default(dirent);
move_dirent(0,@data,@tmp);
i:=Length(f.dirs);
move_dirent(i,@data,@tmp);
i:=Length(f.dirs);
SetLength(f.dirs,i+1);
@ -352,12 +354,14 @@ begin
if (count<>0) then
begin
Move(dirs[pos],buf^,count);
Move(dirs[pos],buf^,count*SizeOf(dirent));
end;
pos:=i;
rwlock_unlock(lock);
Writeln('getdirentries:',count,' ',i);
if (basep<>nil) then
begin
basep^:=i;