#include "wx/utils.h"
#include "wx/app.h"
+#include "wx/process.h"
#include <stdio.h>
#include <stdlib.h>
/* wait4 is not part of any standard, use at own risk
* not sure what wait4 does, but wait3 seems to be closest, whats a digit ;-)
* --- offer@sgi.com */
-#if !defined(__sgi) && !defined(__SGI__) && !defined(__ALPHA__) && !defined(__SUNCC__)
+#if !defined(__HPUX__) && !defined(__sgi) && !defined(__SGI__) && !defined(__ALPHA__) && !defined(__SUNCC__)
wait4(process_data->pid, NULL, 0, NULL);
#else
wait3((int *) NULL, 0, (rusage *) NULL);
XtRemoveInput(*id);
if (process_data->process)
- process_data->process->OnTerminate(process_data->pid);
+ process_data->process->OnTerminate(process_data->pid, 0); // What should 'status' be?
process_data->end_process = TRUE;
-
- if (process_data->pid > 0)
+ /*
+ if (process_data->pid > 0) // synchronous
delete process_data;
else
process_data->pid = 0;
+ */
+ delete process_data;
}
long wxExecute(char **argv, bool sync, wxProcess *handler)
printf ("wxWindows: could not execute '%s'\n", *argv);
_exit (-1);
}
-
+
wxLocalProcessData *process_data = new wxLocalProcessData;
process_data->end_process = 0;
(XtInputCallbackProc) xt_notify_end_process,
(XtPointer) process_data);
- if (sync) {
+ if (sync)
+ {
while (!process_data->end_process)
XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
if (WIFEXITED(process_data->end_process) != 0)
+ {
return WEXITSTATUS(process_data->end_process);
+ }
}
- delete process_data;
-
return pid;
#endif
// end VMS