]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
added wx/defs.h include to correct compilation issues under Mac OS X
[wxWidgets.git] / src / unix / utilsunx.cpp
index 888eb203af989ca0f980371c487d092afde95596..0581126a283e06b858fb6242053c1c8603a9cdd8 100644 (file)
 #include "wx/stream.h"
 
 #ifdef HAVE_STATFS
-    #include <sys/vfs.h>
+#  ifdef __DARWIN__
+#    include <sys/param.h>
+#    include <sys/mount.h>
+#  else
+#    include <sys/vfs.h>
+#  endif
 #endif // HAVE_STATFS
 
 #if wxUSE_GUI
@@ -283,32 +288,12 @@ bool wxShell(const wxString& command, wxArrayString& output)
 
 void wxHandleProcessTermination(wxEndProcessData *proc_data)
 {
-    int pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
-
-    // waitpid is POSIX so should be available everywhere, however on older
-    // systems wait() might be used instead in a loop (until the right pid
-    // terminates)
-    int status = 0;
-    int rc;
-
-    // wait for child termination and if waitpid() was interrupted, try again
-    do
-    {
-       rc = waitpid(pid, &status, 0);
-    }
-    while ( rc == -1 && errno == EINTR );
-
     // notify user about termination if required
     if ( proc_data->process )
     {
-        proc_data->process->OnTerminate
-                            (
-                                proc_data->pid,
-                                (rc == 0) && WIFEXITED(status)
-                                    ? WEXITSTATUS(status)
-                                    : -1
-                            );
+        proc_data->process->OnTerminate(proc_data->pid, proc_data->exitcode);
     }
+
     // clean up
     if ( proc_data->pid > 0 )
     {
@@ -316,9 +301,7 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data)
     }
     else
     {
-       // wxExecute() will know about it
-       proc_data->exitcode = status;
-
+       // let wxExecute() know that the process has terminated
        proc_data->pid = 0;
     }
 }