- close(end_proc_detect[1]); // close writing side
- data->tag = gdk_input_add(end_proc_detect[0], GDK_INPUT_READ,
- GTK_EndProcessDetector, (gpointer)data);
- data->pid = pid;
- if (!sync) {
- data->process = process;
- } else {
- data->process = (wxProcess *) NULL;
- data->pid = -(data->pid);
-
- while (data->pid != 0)
- wxYield();
-
- delete data;
+ _exit(-1);
+ }
+ else {
+ // we're in parent
+ close(end_proc_detect[1]); // close writing side
+ data->tag = gdk_input_add(end_proc_detect[0], GDK_INPUT_READ,
+ GTK_EndProcessDetector, (gpointer)data);
+ data->pid = pid;
+ if (!sync) {
+ data->process = process;
+ }
+ else {
+ data->process = (wxProcess *) NULL;
+ data->pid = -(data->pid);
+
+ while (data->pid != 0)
+ wxYield();
+
+ delete data;
+ }
+
+ // @@@ our return value indicates success even if execvp() in the child
+ // failed!
+ return pid;