]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/utilsexc.cpp
DoSetClientSize omissions fixed; some doc fixes
[wxWidgets.git] / src / motif / utilsexc.cpp
index ed134bd874c3555d55f7a6013bc4a275cf47af14..3c65b50a732cbc5ba34f234a1401519d1156e122 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "wx/utils.h"
 #include "wx/app.h"
+#include "wx/process.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -97,7 +98,7 @@ void xt_notify_end_process(XtPointer client, int *fid,
     /* 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);
@@ -105,14 +106,16 @@ void xt_notify_end_process(XtPointer client, int *fid,
     
     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)
@@ -162,7 +165,7 @@ 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;
@@ -175,16 +178,17 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
         (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