On 05/11/2011 05:22 PM, Daniel Blezek wrote:
> the detach code does not seem to be tested

It is built as a test in KWSys under CMake but is not run automatically.
I don't remember why, but I can run the test by hand and it passes:

 $ ./kwsysTestProcess 8
 Output on stdout before test 8.
 Output on stderr before test 8.
 Output on stderr before grandchild test.
 Output on stdout before grandchild test.
 Child was disowned.
 Output on stdout after grandchild test.
 Output on stderr after grandchild test.
 Output on stdout from grandchild before sleep.
 Output on stderr from grandchild before sleep.
 Child exited with value = 0
 Output on stdout after test 8.
 Output on stderr after test 8.

Note that the output "after grandchild" appears before the output
"from grandchild".  That means the grandchild's parent kept running.

>       itksysProcess_SetCommand ( process, StringCommandLine );
>       itksysProcess_SetOption ( process, itksysProcess_Option_Detach, 1 );
>       itksysProcess_Execute ( process );
>       std::cout << "Execute" << std::endl;

Note that you need to call itksysProcess_Disown() to really let go of
the daemon process.  The Execute() call should return immediately
whether or not the Detach option is set.

-Brad
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to