Boost logo

Boost Users :

Subject: [Boost-users] [Process (Vault)] child::wait error on OS X 10.6
From: Rush Manbert (rush_at_[hidden])
Date: 2009-10-01 16:13:30


I am using the version of the Process library that was announced by
Boris Schaeling in this document:

http://www.highscore.de/cpp/process/

I used the link in the introduction to get the zip file, so I think I
have the correct version.

I am running the following test function:

namespace bp = boost::process;
namespace bios = boost::iostreams;

int BoostProcessTest (void)
{
        std::cout << "\nTesting launch of child process using Boost.Process\n";
        
        std::string exec = bp::find_executable_in_path("svn");
        std::vector<std::string> args;
        args.push_back("svn");
        args.push_back("info");
        
        // context
        bp::context ctx;
        
        // child launch
        bp::child c = bp::launch(exec, args, ctx);
// sleep(1);
        
        //wait
        const bp::status s = c.wait();
        
        // parse status
        if (s.exited() && s.exit_status() == EXIT_SUCCESS)
                std::cout << "Directory is a working copy." << std::endl;
        else
                std::cout << "Directory is not a working copy." << std::endl;
        std::cout << std::endl;
        
        return 0;
}

I call this function in a loop for as long as it returns 0, which
should be forever.

The test is run in a directory that is NOT a svn working copy, so all
that the child process does is to write a line to stderr and exit.

What I'm seeing, however is this message:
Error: Caught an exception! boost::process::child::wait: waitpid(2)
failed: Interrupted system call

The only way I have found to make that go away is by adding the sleep
(1) call (commented out above). Then it runs forever.

I'm hoping Boris will read this and have some idea of what's
happening. My google searches haven't turned up much of value.

- Rush



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net