summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/FileManager.cxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-30 11:12:49 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-30 11:12:49 +0200
commit62eef2c13fb95ab3cee86b0c066d26ceade417dd (patch)
tree7696344260c61374e331f0b24de84c9089e15ae2 /Private/Source/FileManager.cxx
parentf86125cf437fb49587d588413d69646959a58541 (diff)
MHR-18: NewFS: Fix fork allocation.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/FileManager.cxx')
-rw-r--r--Private/Source/FileManager.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/Private/Source/FileManager.cxx b/Private/Source/FileManager.cxx
index aab3cff0..a8c8ad47 100644
--- a/Private/Source/FileManager.cxx
+++ b/Private/Source/FileManager.cxx
@@ -70,10 +70,13 @@ NodePtr NewFilesystemManager::Open(const char* path, const char* r) {
/// @param data
/// @param flags
/// @return
-Void NewFilesystemManager::Write(NodePtr node, VoidPtr data,
- Int32 flags, SizeT size) {
+Void NewFilesystemManager::Write(NodePtr node, VoidPtr data, Int32 flags,
+ SizeT size) {
+ constexpr const char* cReadAllFork = kNewFSDataFork;
+
if ((reinterpret_cast<NewCatalog*>(node))->Kind == kNewFSCatalogKindFile)
- fImpl->WriteCatalog(reinterpret_cast<NewCatalog*>(node), data, size);
+ fImpl->WriteCatalog(reinterpret_cast<NewCatalog*>(node), data, size,
+ cReadAllFork);
}
/**
@@ -87,8 +90,11 @@ Void NewFilesystemManager::Write(NodePtr node, VoidPtr data,
/// @param sz
/// @return
VoidPtr NewFilesystemManager::Read(NodePtr node, Int32 flags, SizeT sz) {
+ constexpr const char* cReadAllFork = kNewFSDataFork;
+
if ((reinterpret_cast<NewCatalog*>(node))->Kind == kNewFSCatalogKindFile)
- return fImpl->ReadCatalog(reinterpret_cast<NewCatalog*>(node), sz);
+ return fImpl->ReadCatalog(reinterpret_cast<NewCatalog*>(node), sz,
+ cReadAllFork);
return nullptr;
}
@@ -124,5 +130,5 @@ bool NewFilesystemManager::Rewind(NodePtr node) {
/// @brief The filesystem implementation.
/// @return
NewFSParser* NewFilesystemManager::GetImpl() noexcept { return fImpl; }
-#endif // __FSKIT_NEWFS__
+#endif // __FSKIT_NEWFS__
} // namespace NewOS