X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7ef06022c3796159e917c7aa0ec47c3ec45c586..ababa106ae015f05e14cd2487100954ef50ca694:/src/unix/utilsunx.cpp?ds=sidebyside diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 6169570d98..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__