We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4025693 commit 6999454Copy full SHA for 6999454
subprocess.hpp
@@ -1630,11 +1630,13 @@ inline void Popen::execute_process() noexcept(false)
1630
try {
1631
char err_buf[SP_MAX_ERR_BUF_SIZ] = {0,};
1632
1633
- int read_bytes = util::read_atmost_n(
1634
- fdopen(err_rd_pipe, "r"),
1635
- err_buf,
1636
- SP_MAX_ERR_BUF_SIZ);
1637
- close(err_rd_pipe);
+ FILE* err_fp = fdopen(err_rd_pipe, "r");
+ if (!err_fp) {
+ close(err_rd_pipe);
+ throw OSError("fdopen failed", errno);
+ }
1638
+ int read_bytes = util::read_atmost_n(err_fp, err_buf, SP_MAX_ERR_BUF_SIZ);
1639
+ fclose(err_fp);
1640
1641
if (read_bytes || strlen(err_buf)) {
1642
// Call waitpid to reap the child process
0 commit comments