+ // wxAddProcessCallback is now (with DARWIN) allowed to call the
+ // callback function directly if the process terminates before
+ // the callback can be added to the run loop. Set up the data.
+ if ( flags & wxEXEC_SYNC )
+ {
+ // we may have process for capturing the program output, but it's
+ // not used in wxEndProcessData in the case of sync execution
+ data->process = NULL;
+
+ // sync execution: indicate it by negating the pid
+ data->pid = -pid;
+ }
+ else
+ {
+ // async execution, nothing special to do - caller will be
+ // notified about the process termination if process != NULL, data
+ // will be deleted in GTK_EndProcessDetector
+ data->process = process;
+ data->pid = pid;
+ }
+
+
+#if defined(__DARWIN__) && defined(__WXMAC__)
+ data->tag = wxAddProcessCallbackForPid(data,pid);
+#else