Skip to content

Commit

Permalink
fix a bug that Solaris doesn't pass unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matyalatte committed Jun 22, 2024
1 parent bea914e commit 2ad9e66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/Test-Env.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ Here is the list of test environments.
| Windows10 | x64 | gcc | | :warning: | :warning: | :warning: |
| Windows10 | arm64 | msvc | | :heavy_check_mark: | :x: | :heavy_check_mark: |
| Windows8 | x64 | | | :x: | :warning: | :x: |
| macOS11 | x64 | clang | | :heavy_check_mark: | :x: | :heavy_check_mark: |
| macOS10.15 | x64 | clang | | :heavy_check_mark: | :heavy_check_mark: | :x: |
| macOS14 | arm64 | clang | | :heavy_check_mark: | :x: | :heavy_check_mark: |
| macOS11 | x64 | clang | | :warning: | :x: | :warning: |
| macOS10.15 | x64 | clang | | :warning: | :warning: | :x: |
| macOS10.12 | x64 | | | :x: | :warning: | :x: |
| Ubuntu20.04 | x64 | gcc | glibc | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Ubuntu20.04 | arm64 | gcc | glibc | :heavy_check_mark: | :x: | :heavy_check_mark: |
Expand All @@ -27,4 +28,4 @@ Here is the list of test environments.
| OpenBSD7.4 | x64 | clang | | :warning: | :warning: | :warning: |
| NetBSD9.3 | x64 | gcc | | :warning: | :warning: | :warning: |
| Haiku R1/beta4 | x64 | gcc | | :warning: | :warning: | :x: |
| OpenIndiana 2024.04 | x64 | gcc | | :warning: | :warning: | :x: |
| OpenIndiana 2024.04 | x64 | gcc | | :warning: | :warning: | :warning: |
4 changes: 2 additions & 2 deletions src/exec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ ExecuteResult Execute(const std::string& cmd) {
unsigned out_read_size = 0;
unsigned err_read_size = 0;

while (subprocess_alive(&process) || out_read_size || err_read_size) {
do {
out_read_size = ReadIO(process, READ_STDOUT, out_buf, BUF_SIZE, last_line, BUF_SIZE);
err_read_size = ReadIO(process, READ_STDERR, err_buf, BUF_SIZE, err_msg, BUF_SIZE * 2);
#ifdef _WIN32
printf("%s", out_buf);
#else
PrintFmt("%s", out_buf);
#endif
}
} while (subprocess_alive(&process) || out_read_size || err_read_size);

// Sometimes stderr still have unread characters
ReadIO(process, READ_STDERR, err_buf, BUF_SIZE, err_msg, BUF_SIZE * 2);
Expand Down

0 comments on commit 2ad9e66

Please sign in to comment.