Skip to content

Commit 1dd9528

Browse files
committed
fix: fix FreeBSD build
We refactored file_handle_ref::write, but forgot to update one call site. This causes build failures on FreeBSD. Fix the failure.
1 parent eba51ae commit 1dd9528

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Semantic Versioning.
3333
the language standard.
3434
* `((x)) => {}` no longer crashes the parser with an assertion failure.
3535
* Tests now pass if the user's locale is Italian (`it_IT.utf8` on Linux).
36+
* The FreeBSD build now succeeds.
3637

3738
## 2.5.0 (2022-05-23)
3839

src/file-handle.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,10 @@ std::size_t posix_fd_file_ref::get_pipe_buffer_size() {
319319
std::size_t pipe_buffer_size = 0;
320320
for (;;) {
321321
unsigned char c = 0;
322-
std::optional<int> written = pipe.writer.write(&c, sizeof(c));
323-
if (!written.has_value()) {
322+
result<std::size_t, posix_file_io_error> written =
323+
pipe.writer.write(&c, sizeof(c));
324+
if (!written.ok()) {
325+
QLJS_ASSERT(written.error().error == EAGAIN);
324326
break;
325327
}
326328
pipe_buffer_size += *written;

0 commit comments

Comments
 (0)