Intel compilation fix (patch 1540790)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
#include "wx/thread.h"
|
#include "wx/thread.h"
|
||||||
#include "wx/process.h"
|
#include "wx/process.h"
|
||||||
|
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
// Use polling instead of Mach ports, which doesn't work on Intel
|
// Use polling instead of Mach ports, which doesn't work on Intel
|
||||||
// due to task_for_pid security issues.
|
// due to task_for_pid security issues.
|
||||||
|
|
||||||
@@ -116,10 +118,9 @@ int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else // !USE_POLLING
|
||||||
|
|
||||||
#include <CoreFoundation/CFMachPort.h>
|
#include <CoreFoundation/CFMachPort.h>
|
||||||
#include <sys/wait.h>
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
}
|
}
|
||||||
@@ -132,13 +133,13 @@ void wxMAC_MachPortEndProcessDetect(CFMachPortRef port, void *data)
|
|||||||
int rc = waitpid(abs(proc_data->pid), &status, WNOHANG);
|
int rc = waitpid(abs(proc_data->pid), &status, WNOHANG);
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Mach port was invalidated, but process hasn't terminated!"));
|
wxLogDebug(wxT("Mach port was invalidated, but process hasn't terminated!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((rc != -1) && WIFEXITED(status))
|
if((rc != -1) && WIFEXITED(status))
|
||||||
proc_data->exitcode = WEXITSTATUS(status);
|
proc_data->exitcode = WEXITSTATUS(status);
|
||||||
else
|
else
|
||||||
proc_data->exitcode = -1;
|
proc_data->exitcode = -1;
|
||||||
wxHandleProcessTermination(proc_data);
|
wxHandleProcessTermination(proc_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +211,7 @@ int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_POLLING
|
#endif // USE_POLLING/!USE_POLLING
|
||||||
|
|
||||||
// NOTE: This doesn't really belong here but this was a handy file to
|
// NOTE: This doesn't really belong here but this was a handy file to
|
||||||
// put it in because it's already compiled for wxCocoa and wxMac GUI lib.
|
// put it in because it's already compiled for wxCocoa and wxMac GUI lib.
|
||||||
|
Reference in New Issue
Block a user