Skip to content

Commit

Permalink
aslp-cpp: exit from forked server subprocess
Browse files Browse the repository at this point in the history
the forked subprocess should not return to its caller.

also fixes an "unused return value" wawrning from std::system.
  • Loading branch information
katrinafyi committed Dec 26, 2024
1 parent 552d319 commit 83721db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aslp-cpp/source/aslp-cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ auto aslp_client::start(const std::string& addr, int server_port)
auto command = std::format(
"opam exec -- aslp-server --host {} --port {}", addr, server_port);
std::cerr << command << std::endl;
std::system(command.c_str());
std::cerr << "Child process exited." << std::endl;
int retcode = std::system(command.c_str());
std::cerr << "Child process exited with code: " << retcode << std::endl;
std::exit(retcode);
return {nullptr};
}

Expand Down

0 comments on commit 83721db

Please sign in to comment.