X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74c719ed9683d49e206b19e8e693d649a1a3b7d1..4ae1af0588794ab2b46e376ec20f1b1f6b1715d0:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 2c375b2edb..6115ef3330 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -200,9 +200,12 @@ void wxMilliSleep(unsigned long milliseconds) // process management // ---------------------------------------------------------------------------- -int wxKill(long pid, wxSignal sig, wxKillError *rc) +int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags) { - int err = kill((pid_t)pid, (int)sig); + int err = kill((pid_t) (flags & wxKILL_CHILDREN) ? -pid : pid, (int)sig); + if ( !err ) + *rc = wxKILL_OK; + else if ( rc ) { switch ( errno ) @@ -837,11 +840,20 @@ bool wxGetUserName(wxChar *buf, int sz) wxString wxGetOsDescription() { -#ifndef WXWIN_OS_DESCRIPTION - #error WXWIN_OS_DESCRIPTION should be defined in config.h by configure -#else - return wxString::FromAscii( WXWIN_OS_DESCRIPTION ); -#endif + FILE *f = popen("uname -s -r -m", "r"); + if (f) + { + char buf[256]; + size_t c = fread(buf, 1, sizeof(buf) - 1, f); + pclose(f); + // Trim newline from output. + if (c && buf[c - 1] == '\n') + --c; + buf[c] = '\0'; + return wxString::FromAscii( buf ); + } + wxFAIL_MSG( _T("uname failed") ); + return _T(""); } #endif // !__WXMAC__ @@ -1143,7 +1155,7 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData) } -#if defined(__DARWIN__) && defined(__WXMAC__) +#if defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__)) endProcData->tag = wxAddProcessCallbackForPid(endProcData, execData.pid); #else endProcData->tag = wxAddProcessCallback @@ -1153,7 +1165,7 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData) ); execData.pipeEndProcDetect.Close(); -#endif // defined(__DARWIN__) && defined(__WXMAC__) +#endif // defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__)) if ( execData.flags & wxEXEC_SYNC ) {