+#if !defined(__VMS) && !defined(__EMX__)
+ if ( flags & wxEXEC_MAKE_GROUP_LEADER )
+ {
+ // Set process group to child process' pid. Then killing -pid
+ // of the parent will kill the process and all of its children.
+ setsid();
+ }
+#endif // !__VMS
+
+#if wxUSE_GUI && !(defined(__DARWIN__) && defined(__WXMAC__))
+ // reading side can be safely closed but we should keep the write one
+ // opened
+ pipeEndProcDetect.Detach(wxPipe::Write);
+ pipeEndProcDetect.Close();
+#endif // wxUSE_GUI && !(defined(__DARWIN__) && defined(__WXMAC__))
+
+ // redirect stdin, stdout and stderr
+ if ( pipeIn.IsOk() )