Skip to content

Commit

Permalink
Merge pull request #19340 from hrydgard/getstat-dir-fix
Browse files Browse the repository at this point in the history
sceIoGetStat: Fix retrieving timestamps from directories
  • Loading branch information
hrydgard authored Jul 18, 2024
2 parents a76afa9 + d331e80 commit 4b615f0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "build/PPSSPPSDL",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
23 changes: 23 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"tasks": [
{
"type": "shell",
"label": "C/C++: build",
"command": "./b.sh",
"args": [
"--debug",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/g++"
},
]
}
16 changes: 8 additions & 8 deletions Core/FileSystems/DirectoryFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,15 +697,15 @@ PSPFileInfo DirectoryFileSystem::GetFileInfo(std::string filename) {

if (x.type != FILETYPE_DIRECTORY) {
x.size = info.size;
x.access = info.access;
time_t atime = info.atime;
time_t ctime = info.ctime;
time_t mtime = info.mtime;

localtime_r((time_t*)&atime, &x.atime);
localtime_r((time_t*)&ctime, &x.ctime);
localtime_r((time_t*)&mtime, &x.mtime);
}
x.access = info.access;
time_t atime = info.atime;
time_t ctime = info.ctime;
time_t mtime = info.mtime;

localtime_r((time_t*)&atime, &x.atime);
localtime_r((time_t*)&ctime, &x.ctime);
localtime_r((time_t*)&mtime, &x.mtime);

return ReplayApplyDiskFileInfo(x, CoreTiming::GetGlobalTimeUs());
}
Expand Down

0 comments on commit 4b615f0

Please sign in to comment.