vfs: Fix GetRoot(), CacheRecursiveSearch() and root identifier

This commit is contained in:
EnderIce2
2024-10-13 02:33:46 +03:00
parent 850b8ec490
commit f48032658f
4 changed files with 40 additions and 31 deletions

View File

@ -45,10 +45,10 @@ namespace vfs
return -ENOENT;
off_t offset = 0;
foreach (const auto &Root in Parent->Children)
for (const auto &Root : Parent->Children)
{
char rootName[128]{};
snprintf(rootName, sizeof(rootName), "\x02root-%ld\x03", offset);
snprintf(rootName, sizeof(rootName), "\x06root-%ld\x06", offset);
if (strcmp(rootName, Name) == 0)
{
@ -159,8 +159,8 @@ namespace vfs
S_IRWXO |
S_IFDIR;
FileNode *proc = this->ForceCreate(this->GetRoot(0), "proc", mode);
FileNode *log = this->ForceCreate(this->GetRoot(0), "var", mode);
log = this->ForceCreate(log, "log", mode);
FileNode *var = this->ForceCreate(this->GetRoot(0), "var", mode);
FileNode *log = this->ForceCreate(var, "log", mode);
proc->Node->Flags = iFlags;
log->Node->Flags = iFlags;