X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85da04e95be79f3313dd45f660683bd3d4c505a2..578dc95029e761a59911b7c1bc09f59384d64ddf:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index c375770794..fd816cb920 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -203,6 +203,16 @@ long wxExecute( const wxString& command, int flags, wxProcess *process ) { wxCHECK_MSG( !command.IsEmpty(), 0, wxT("can't exec empty command") ); +#if wxUSE_THREADS + // fork() doesn't mix well with POSIX threads: on many systems the program + // deadlocks or crashes for some reason. Probably our code is buggy and + // doesn't do something which must be done to allow this to work, but I + // don't know what yet, so for now just warn the user (this is the least we + // can do) about it + wxASSERT_MSG( wxThread::IsMain(), + _T("wxExecute() can be called only from the main thread") ); +#endif // wxUSE_THREADS + int argc = 0; wxChar *argv[WXEXECUTE_NARGS]; wxString argument; @@ -644,6 +654,11 @@ long wxExecute(wxChar **argv, execvp (*mb_argv, mb_argv); + fprintf(stderr, "execvp("); + for ( char **ppc = mb_argv; *ppc; ppc++ ) + fprintf(stderr, "%s%s", ppc == mb_argv ? "" : ", ", *ppc); + fprintf(stderr, ") failed with error %d!\n", errno); + // there is no return after successful exec() _exit(-1);