| 500 | // ---------------------------------------------------------------------------------------- |
| 501 | |
| 502 | void subprocess_stream:: |
| 503 | wait() |
| 504 | { |
| 505 | if (!wait_called) |
| 506 | { |
| 507 | wait_called = true; |
| 508 | send_eof(); |
| 509 | |
| 510 | std::ostringstream sout; |
| 511 | sout << stderr.rdbuf(); |
| 512 | |
| 513 | try{check_for_matlab_ctrl_c();} catch(...) |
| 514 | { |
| 515 | kill(child_pid, SIGTERM); |
| 516 | } |
| 517 | |
| 518 | int status; |
| 519 | waitpid(child_pid, &status, 0); |
| 520 | if (status) |
| 521 | throw dlib::error("Child process terminated with an error.\n" + sout.str()); |
| 522 | |
| 523 | if (sout.str().size() != 0) |
| 524 | throw dlib::error("Child process terminated with an error.\n" + sout.str()); |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | // ---------------------------------------------------------------------------------------- |
| 529 |
nothing calls this directly
no test coverage detected