-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Description
When calling terminate on a V2 process, the exit code on async_wait() is 0, but should be 9 (SIGKILL).
#include <boost/asio.hpp>
#include <boost/process/v2/process.hpp>
#include <iostream>
int main()
{
boost::asio::io_context context;
boost::process::v2::process child(context, "/usr/bin/sleep", {"10"});
child.async_wait([](boost::system::error_code ec, int status){
std::cout << status << std::endl;
});
child.terminate(); // prints 0 -- should be 9 (SIGKILL)
// child.interrupt(); // prints 2 (SIGINT)
// child.request_exit(); // prints 15 (SIGTERM)
context.run();
}This seems to be due to the implementation of terminate(), which -- unlike interrupt() and request_exit -- also calls wait:
| wait(exit_status, ec); |
That wait() correctly retireves exit status 9, but before async_execute() completes, ::waitpid() is invoked again somewhere. If the wait() is removed, termiante() behaves correctly -- but I do not know if that has other implications.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels