Skip to content

Fix issues #103 and #104 #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions subprocess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1630,11 +1630,13 @@ inline void Popen::execute_process() noexcept(false)
try {
char err_buf[SP_MAX_ERR_BUF_SIZ] = {0,};

int read_bytes = util::read_atmost_n(
fdopen(err_rd_pipe, "r"),
err_buf,
SP_MAX_ERR_BUF_SIZ);
close(err_rd_pipe);
FILE* err_fp = fdopen(err_rd_pipe, "r");
if (!err_fp) {
close(err_rd_pipe);
throw OSError("fdopen failed", errno);
}
int read_bytes = util::read_atmost_n(err_fp, err_buf, SP_MAX_ERR_BUF_SIZ);
fclose(err_fp);

if (read_bytes || strlen(err_buf)) {
// Call waitpid to reap the child process
Expand Down