We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#include "subprocess.hpp" using namespace subprocess; int main() { std::vector<std::string> flags = {"ls", "nosuchfile"}; std::string command = subprocess::util::join(flags); auto p = subprocess::Popen(command); // while (p.poll() == -1) { // usleep(100 * 1000); // } p.wait(); std::cout << "result " << p.retcode() << std::endl; }
Outputs result: -1
result: -1
While the below outputs result: 0.
result: 0
#include "subprocess.hpp" using namespace subprocess; int main() { std::vector<std::string> flags = {"ls", "nosuchfile"}; std::string command = subprocess::util::join(flags); auto p = subprocess::Popen(command); while (p.poll() == -1) { usleep(100 * 1000); } // p.wait(); std::cout << "result " << p.retcode() << std::endl; }
The text was updated successfully, but these errors were encountered:
wait() doesn't update retcode.
wait()
Sorry, something went wrong.
Thanks. The pull request has been merged.
No branches or pull requests
Outputs
result: -1
While the below outputs
result: 0
.The text was updated successfully, but these errors were encountered: