X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab857a4ed6687929e308ea606f65ceedc43d1319..b704229ee25ef8e5765ec09e9c164f59063564e8:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index c8bdafd3bf..2082e6bca1 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -23,6 +23,7 @@ #include "wx/utils.h" #include "wx/process.h" +#include "wx/thread.h" #include "wx/unix/execute.h" @@ -64,20 +65,21 @@ #ifdef __SUN__ int usleep(unsigned int usec); #else // !Sun - #ifdef __EMX__ - /* I copied this from the XFree86 diffs. AV. */ - #define INCL_DOSPROCESS - #include - void usleep(unsigned long delay) - { - DosSleep(delay ? (delay/1000l) : 1l); - } - #else - void usleep(unsigned long usec); - #endif + #ifdef __EMX__ + /* I copied this from the XFree86 diffs. AV. */ + #define INCL_DOSPROCESS + #include + inline void usleep(unsigned long delay) + { + DosSleep(delay ? (delay/1000l) : 1l); + } + #else // !Sun && !EMX + void usleep(unsigned long usec); + #endif #endif // Sun/EMX/Something else }; -#define HAVE_USLEEP 1 + + #define HAVE_USLEEP 1 #endif // Unices without usleep() // ============================================================================ @@ -219,17 +221,19 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data) 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 == ERESTARTSYS || */ errno == EINTR) ); - // waitpid() was interrupted, try again + } + while ( rc == -1 && errno == EINTR ); + - if( rc == -1 || ! (WIFEXITED(status) || WIFSIGNALED(status)) ) { wxLogSysError(_("Waiting for subprocess termination failed")); /* AFAIK, this can only happen if something went wrong within - wxGTK, i.e. due to a racecondition or some serious bug. + wxGTK, i.e. due to a race condition or some serious bug. After having fixed the order of statements in GTK_EndProcessDetector(). (KB) */ @@ -251,7 +255,7 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data) { // wxExecute() will know about it proc_data->exitcode = status; - + proc_data->pid = 0; } } @@ -580,6 +584,15 @@ bool wxGetUserName(wxChar *buf, int sz) return FALSE; } +wxString wxGetOsDescription() +{ +#ifndef WXWIN_OS_DESCRIPTION + #error WXWIN_OS_DESCRIPTION should be defined in config.h by configure +#else + return WXWIN_OS_DESCRIPTION; +#endif +} + // ---------------------------------------------------------------------------- // error and debug output routines (deprecated, use wxLog) // ----------------------------------------------------------------------------