diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-01 09:41:25 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-01 09:41:25 +0200 |
| commit | 9e4a472c109d91ae9550b9474425ce16e081894b (patch) | |
| tree | 9acdadaee3deefa74fb0bfd17cbec308ef2d4a33 /Kernel/Sources | |
| parent | 8ee087a640c2ecf592555457f38ff152bd2f2d2e (diff) | |
IMP: NewFS: Update ErrLocal if file we want to create exists.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/Sources')
| -rw-r--r-- | Kernel/Sources/FS/NewFS.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Kernel/Sources/FS/NewFS.cxx b/Kernel/Sources/FS/NewFS.cxx index 63aa598e..20451f96 100644 --- a/Kernel/Sources/FS/NewFS.cxx +++ b/Kernel/Sources/FS/NewFS.cxx @@ -226,14 +226,17 @@ _Output NewCatalog* NewFSParser::CreateCatalog(_Input const char* name, name[rt_string_len(name) - 1] == NewFilesystemHelper::Separator()) return nullptr; - NewCatalog* checkForCpy = this->FindCatalog(name, outLba); + NewCatalog* copyExists = this->FindCatalog(name, outLba); - if (checkForCpy) + if (copyExists) { - return checkForCpy; + kcout << "newoskrnl: copy already exists.\r"; + ErrLocal() = kErrorFileExists; + + return copyExists; } - char parentName[kNewFSNodeNameLen] = {0}; + Char parentName[kNewFSNodeNameLen] = {0}; for (SizeT indexName = 0UL; indexName < rt_string_len(name); ++indexName) { @@ -255,10 +258,10 @@ _Output NewCatalog* NewFSParser::CreateCatalog(_Input const char* name, SizeT indexReverseCopy = rt_string_len(parentName); - // zero character. + // zero character it. parentName[--indexReverseCopy] = 0; - // mandatory / character. + // mandatory / character, zero it. parentName[--indexReverseCopy] = 0; while (parentName[indexReverseCopy] != NewFilesystemHelper::Separator()) |
