I just don't seem to be able to figure this out. I wrote some program which spawns a child process with redirected input/output which is used to execute other programs specified by an .xml file via an exec element. All are good and working except one thing.
The return code of the program. For testing purposes I have a dummy program e.g.
1 2 3 4 5 6 7 8 9 10
#include <iostream>
int main(int argc, char *argv[])
{
std::cout<<"<failure>test failure</failure>"<<std::endl;
std::cerr<<"Something went wrong..."<<std::endl;
for (int x=0; x<argc; x++)
std::cout<<argv[x]<<std::endl;
return 0;
}
This always returns 0.
While the output/input redirection works just fine, when I call