From 7487eea1b802bf0f45afcef5807251049b034dd8 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 1 Oct 2024 12:10:02 -0700 Subject: More bug fixes --- src/stable/myriad.cpp | 4 +--- src/tests/myriadfs.cpp | 2 +- src/unstable/myriadfs.cpp | 4 ++-- src/unstable/myriadfs.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/stable/myriad.cpp b/src/stable/myriad.cpp index 03cffa9..5e511fd 100644 --- a/src/stable/myriad.cpp +++ b/src/stable/myriad.cpp @@ -768,9 +768,7 @@ int32_t Bu::Myriad::Stream::read( int32_t iStart, void *pTarget, if( iStart+iSize >= this->iSize ) { - int32_t iDiff = (iStart+iSize)-this->iSize; - iSize -= iDiff; - iStart += iDiff; + iSize = this->iSize-iStart; } while( iSize > 0 ) diff --git a/src/tests/myriadfs.cpp b/src/tests/myriadfs.cpp index 1266e4b..29ac3d9 100644 --- a/src/tests/myriadfs.cpp +++ b/src/tests/myriadfs.cpp @@ -9,7 +9,7 @@ using namespace Bu; int main() { // Bu::MemBuf mb; - Bu::File mb("store.myr", File::Read|File::Write|File::Create ); + Bu::File mb("store.mfs", File::Read|File::Write|File::Create ); Bu::MyriadFs mfs( mb, 512 ); sio << "Creating dirs..." << sio.nl; diff --git a/src/unstable/myriadfs.cpp b/src/unstable/myriadfs.cpp index ab9ca74..2eda0be 100644 --- a/src/unstable/myriadfs.cpp +++ b/src/unstable/myriadfs.cpp @@ -574,7 +574,7 @@ int32_t Bu::MyriadFs::allocInode( uint16_t uPerms, uint32_t uSpecial ) case typeSymLink: { Bu::MyriadStream ms = mStore.create( - Bu::Myriad::Create + Bu::Myriad::Read ); rs.uStreamIndex = ms.getId(); } @@ -583,7 +583,7 @@ int32_t Bu::MyriadFs::allocInode( uint16_t uPerms, uint32_t uSpecial ) case typeDir: { Bu::MyriadStream ms = mStore.create( - Bu::Myriad::Create + Bu::Myriad::Read ); rs.uStreamIndex = ms.getId(); } diff --git a/src/unstable/myriadfs.h b/src/unstable/myriadfs.h index ff14292..eccac65 100644 --- a/src/unstable/myriadfs.h +++ b/src/unstable/myriadfs.h @@ -108,7 +108,7 @@ namespace Bu Truncate = 0x08, ///< Truncate file if it does exist Append = 0x10, ///< Always append on every write NonBlock = 0x20, ///< Open file in non-blocking mode - Exclusive = 0x44, ///< Create file, if it exists then fail + Exclusive = 0x40, ///< Create file, if it exists then fail // Helpful mixes ReadWrite = 0x03, ///< Open for reading and writing -- cgit v1.2.3