diff options
author | Mike Buland <mike@xagasoft.com> | 2024-10-01 12:10:02 -0700 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2024-10-01 12:10:02 -0700 |
commit | 7487eea1b802bf0f45afcef5807251049b034dd8 (patch) | |
tree | c00f87c3a982f8b43fd9e16444eb2df8e0079710 /src | |
parent | 03cafb600101c4bc659521b833a1f3a8c56938be (diff) | |
download | libbu++-7487eea1b802bf0f45afcef5807251049b034dd8.tar.gz libbu++-7487eea1b802bf0f45afcef5807251049b034dd8.tar.bz2 libbu++-7487eea1b802bf0f45afcef5807251049b034dd8.tar.xz libbu++-7487eea1b802bf0f45afcef5807251049b034dd8.zip |
More bug fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/stable/myriad.cpp | 4 | ||||
-rw-r--r-- | src/tests/myriadfs.cpp | 2 | ||||
-rw-r--r-- | src/unstable/myriadfs.cpp | 4 | ||||
-rw-r--r-- | src/unstable/myriadfs.h | 2 |
4 files changed, 5 insertions, 7 deletions
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, | |||
768 | 768 | ||
769 | if( iStart+iSize >= this->iSize ) | 769 | if( iStart+iSize >= this->iSize ) |
770 | { | 770 | { |
771 | int32_t iDiff = (iStart+iSize)-this->iSize; | 771 | iSize = this->iSize-iStart; |
772 | iSize -= iDiff; | ||
773 | iStart += iDiff; | ||
774 | } | 772 | } |
775 | 773 | ||
776 | while( iSize > 0 ) | 774 | 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; | |||
9 | int main() | 9 | int main() |
10 | { | 10 | { |
11 | // Bu::MemBuf mb; | 11 | // Bu::MemBuf mb; |
12 | Bu::File mb("store.myr", File::Read|File::Write|File::Create ); | 12 | Bu::File mb("store.mfs", File::Read|File::Write|File::Create ); |
13 | Bu::MyriadFs mfs( mb, 512 ); | 13 | Bu::MyriadFs mfs( mb, 512 ); |
14 | 14 | ||
15 | sio << "Creating dirs..." << sio.nl; | 15 | 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 ) | |||
574 | case typeSymLink: | 574 | case typeSymLink: |
575 | { | 575 | { |
576 | Bu::MyriadStream ms = mStore.create( | 576 | Bu::MyriadStream ms = mStore.create( |
577 | Bu::Myriad::Create | 577 | Bu::Myriad::Read |
578 | ); | 578 | ); |
579 | rs.uStreamIndex = ms.getId(); | 579 | rs.uStreamIndex = ms.getId(); |
580 | } | 580 | } |
@@ -583,7 +583,7 @@ int32_t Bu::MyriadFs::allocInode( uint16_t uPerms, uint32_t uSpecial ) | |||
583 | case typeDir: | 583 | case typeDir: |
584 | { | 584 | { |
585 | Bu::MyriadStream ms = mStore.create( | 585 | Bu::MyriadStream ms = mStore.create( |
586 | Bu::Myriad::Create | 586 | Bu::Myriad::Read |
587 | ); | 587 | ); |
588 | rs.uStreamIndex = ms.getId(); | 588 | rs.uStreamIndex = ms.getId(); |
589 | } | 589 | } |
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 | |||
108 | Truncate = 0x08, ///< Truncate file if it does exist | 108 | Truncate = 0x08, ///< Truncate file if it does exist |
109 | Append = 0x10, ///< Always append on every write | 109 | Append = 0x10, ///< Always append on every write |
110 | NonBlock = 0x20, ///< Open file in non-blocking mode | 110 | NonBlock = 0x20, ///< Open file in non-blocking mode |
111 | Exclusive = 0x44, ///< Create file, if it exists then fail | 111 | Exclusive = 0x40, ///< Create file, if it exists then fail |
112 | 112 | ||
113 | // Helpful mixes | 113 | // Helpful mixes |
114 | ReadWrite = 0x03, ///< Open for reading and writing | 114 | ReadWrite = 0x03, ///< Open for reading and writing |