From 807c1dfe8a897f9c61bf3549ff2566917b53023b Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 24 Jun 2024 00:06:25 +0800 Subject: feat: fix linux build, complete PosixSpawnSubProcess. NEED TEST: BufferStream, AutoReadStream, SubProcess. --- src/common/io/BufferStream.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common/io/BufferStream.cpp') 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_) { -- cgit v1.2.3