fix: ramdisk Open no longer opens directory entries
SYS_OPEN succeeded on directory tar entries, so userspace stat() - which tries open-as-file first - reported every directory as a regular file. GCC's include-path setup stats each search directory and rejected all the real ones with "not a directory" warnings. Directories now fall through Open to -1 and stat() classifies them via the (recently fixed) ReadDir existence probe. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -12,4 +12,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define MONTAUK_BUILD_NUMBER 20
|
#define MONTAUK_BUILD_NUMBER 21
|
||||||
|
|||||||
@@ -175,6 +175,13 @@ namespace Fs::Ramdisk {
|
|||||||
if (path[0] == '/') path++;
|
if (path[0] == '/') path++;
|
||||||
|
|
||||||
for (int i = 0; i < fileCount; i++) {
|
for (int i = 0; i < fileCount; i++) {
|
||||||
|
// Directories are not openable as files. Without this,
|
||||||
|
// userspace stat() classified every directory with a tar
|
||||||
|
// entry as a regular file (GCC's include-path setup then
|
||||||
|
// rejected real directories with "not a directory").
|
||||||
|
if (fileTable[i].isDirectory) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (StrEqual(fileTable[i].name, path)) {
|
if (StrEqual(fileTable[i].name, path)) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user