summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/FS
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-30 11:58:58 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-30 12:04:01 +0200
commit3033b78abc6ff3dad05994fa51bcd92bf3dae542 (patch)
treeef52ada6b602c50f88e25d4624373ced523cc772 /Private/Source/FS
parent88d9199c65191647641bf06fbaa708d40e53c752 (diff)
AppMain.cxx: Add canary file, which prevents data corruption.
TODO: this file must be protected. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/FS')
-rw-r--r--Private/Source/FS/NewFS.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Private/Source/FS/NewFS.cxx b/Private/Source/FS/NewFS.cxx
index c9df501d..0057af20 100644
--- a/Private/Source/FS/NewFS.cxx
+++ b/Private/Source/FS/NewFS.cxx
@@ -66,15 +66,16 @@ _Output NewFork* NewFSParser::CreateFork(_Input NewCatalog* catalog,
prevFork = cpyFork;
} else {
- break;
- }
- }
+ /// This is a check that we have, in order to link the previous fork entry.
+ if (lba >= kNewFSCatalogStartAddress) {
+ prevFork.NextSibling = lba;
+ /// write to disk.
+ drv->fOutput(&drv->fPacket);
+ }
- if (lba >= kNewFSCatalogStartAddress) {
- prevFork.NextSibling = lba;
-
- drv->fOutput(&drv->fPacket);
+ break;
+ }
}
constexpr auto cForkPadding = 4;
@@ -90,6 +91,7 @@ _Output NewFork* NewFSParser::CreateFork(_Input NewCatalog* catalog,
drv->fOutput(&drv->fPacket);
+ /// log what we have now.
kcout << "New OS: Wrote fork data at: " << hex_number(theFork.DataOffset) << endl;
kcout << "New OS: Wrote fork at: " << hex_number(lba) << endl;