diff options
author | crupest <crupest@outlook.com> | 2024-06-24 00:06:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-06-25 00:12:29 +0800 |
commit | 807c1dfe8a897f9c61bf3549ff2566917b53023b (patch) | |
tree | 8f0bfed314747ff570fa99577e8954060194ed7f /src/common/io/BufferStream.cpp | |
parent | 2f5651cd1a1efb136179cdbcb3b29ed0cc11ca2a (diff) | |
download | cru-807c1dfe8a897f9c61bf3549ff2566917b53023b.tar.gz cru-807c1dfe8a897f9c61bf3549ff2566917b53023b.tar.bz2 cru-807c1dfe8a897f9c61bf3549ff2566917b53023b.zip |
feat: fix linux build, complete PosixSpawnSubProcess.
NEED TEST: BufferStream, AutoReadStream, SubProcess.
Diffstat (limited to 'src/common/io/BufferStream.cpp')
-rw-r--r-- | src/common/io/BufferStream.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/io/BufferStream.cpp b/src/common/io/BufferStream.cpp index 3060a608..242396cd 100644 --- a/src/common/io/BufferStream.cpp +++ b/src/common/io/BufferStream.cpp @@ -75,6 +75,10 @@ Index BufferStream::Write(const std::byte* buffer, Index offset, Index size) { Index written = 0; + if (empty) { + buffer_list_.push_back(Buffer(block_size_)); + } + while (true) { if (buffer_list_.back().GetBackFree() == 0) { if (max_block_count_ > 0 && buffer_list_.size() == max_block_count_) { |