X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..b4446c244775324631b8dd2b588ea35f32e71728:/src/mac/classic/utilsexc.cpp diff --git a/src/mac/classic/utilsexc.cpp b/src/mac/classic/utilsexc.cpp index a32b21d74d..0645d04a5f 100644 --- a/src/mac/classic/utilsexc.cpp +++ b/src/mac/classic/utilsexc.cpp @@ -1,20 +1,22 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utilsexec.cpp +// Name: src/mac/classic/utilsexec.cpp // Purpose: Execution-related utilities // Author: Stefan Csomor // Modified by: David Elliott // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -//#pragma implementation -#endif +#include "wx/wxprec.h" -#include "wx/log.h" #include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" +#endif + #ifdef __DARWIN__ #include "wx/unix/execute.h" #include @@ -137,20 +139,20 @@ long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler)) #ifdef __DARWIN__ void wxMAC_MachPortEndProcessDetect(CFMachPortRef port, void *data) { - wxEndProcessData *proc_data = (wxEndProcessData*)data; - wxLogDebug(wxT("Wow.. this actually worked!")); - int status = 0; - int rc = waitpid(abs(proc_data->pid), &status, WNOHANG); - if(!rc) - { - wxLogDebug(wxT("Mach port was invalidated, but process hasn't terminated!")); - return; - } - if((rc != -1) && WIFEXITED(status)) - proc_data->exitcode = WEXITSTATUS(status); - else - proc_data->exitcode = -1; - wxHandleProcessTermination(proc_data); + wxEndProcessData *proc_data = (wxEndProcessData*)data; + wxLogDebug(wxT("Wow.. this actually worked!")); + int status = 0; + int rc = waitpid(abs(proc_data->pid), &status, WNOHANG); + if(!rc) + { + wxLogDebug(wxT("Mach port was invalidated, but process hasn't terminated!")); + return; + } + if((rc != -1) && WIFEXITED(status)) + proc_data->exitcode = WEXITSTATUS(status); + else + proc_data->exitcode = -1; + wxHandleProcessTermination(proc_data); } int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid) @@ -212,7 +214,7 @@ int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid) wxLogDebug(wxT("Couldn't create runloopsource")); return -1; } - + CFRelease(CFMachPortForProcess); CFRunLoopAddSource(CFRunLoopGetCurrent(),runloopsource,kCFRunLoopDefaultMode);