X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e408bf5257ead0754de5ef37a39867c7536dbe03..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index f45510ae42..f4918245fb 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/unix/utilsunx.cpp -// Purpose: generic Unix implementation of many wx functions +// Purpose: generic Unix implementation of many wx functions (for wxBase) // Author: Vadim Zeitlin // Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Vadim Zeitlin @@ -202,7 +202,7 @@ void wxMicroSleep(unsigned long microseconds) tmReq.tv_nsec = (microseconds % 1000000) * 1000; // we're not interested in remaining time nor in return value - (void)nanosleep(&tmReq, (timespec *)NULL); + (void)nanosleep(&tmReq, NULL); #elif defined(HAVE_USLEEP) // uncomment this if you feel brave or if you are sure that your version // of Solaris has a safe usleep() function but please notice that usleep() @@ -429,7 +429,7 @@ private: int m_argc; char **m_argv; - DECLARE_NO_COPY_CLASS(ArgsArray) + wxDECLARE_NO_COPY_CLASS(ArgsArray); }; } // anonymous namespace @@ -542,30 +542,10 @@ long wxExecute(char **argv, int flags, wxProcess *process) } else if ( pid == 0 ) // we're in child { - // These lines close the open file descriptors to to avoid any - // input/output which might block the process or irritate the user. If - // one wants proper IO for the subprocess, the right thing to do is to - // start an xterm executing it. - if ( !(flags & wxEXEC_SYNC) ) - { - // FD_SETSIZE is unsigned under BSD, signed under other platforms - // so we need a cast to avoid warnings on all platforms - for ( int fd = 0; fd < (int)FD_SETSIZE; fd++ ) - { - if ( fd == pipeIn[wxPipe::Read] - || fd == pipeOut[wxPipe::Write] - || fd == pipeErr[wxPipe::Write] - || fd == (execData.pipeEndProcDetect)[wxPipe::Write] ) - { - // don't close this one, we still need it - continue; - } - - // leave stderr opened too, it won't do any harm - if ( fd != STDERR_FILENO ) - close(fd); - } - } + // NB: we used to close all the unused descriptors of the child here + // but this broke some programs which relied on e.g. FD 1 being + // always opened so don't do it any more, after all there doesn't + // seem to be any real problem with keeping them opened #if !defined(__VMS) && !defined(__EMX__) if ( flags & wxEXEC_MAKE_GROUP_LEADER ) @@ -891,7 +871,7 @@ bool wxIsPlatform64Bit() machine.Contains(wxT("alpha")); } -// these functions are in mac/utils.cpp for wxMac +// these functions are in src/osx/utilsexc_base.cpp for wxMac #ifndef __WXMAC__ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) @@ -1283,7 +1263,7 @@ public: protected: const int m_fd; - DECLARE_NO_COPY_CLASS(wxReadFDIOHandler) + wxDECLARE_NO_COPY_CLASS(wxReadFDIOHandler); }; // class for monitoring our end of the process detection pipe, simply sets a @@ -1304,7 +1284,7 @@ public: private: bool m_terminated; - DECLARE_NO_COPY_CLASS(wxEndHandler) + wxDECLARE_NO_COPY_CLASS(wxEndHandler); }; #if HAS_PIPE_INPUT_STREAM @@ -1333,7 +1313,7 @@ public: private: wxStreamTempInputBuffer * const m_buf; - DECLARE_NO_COPY_CLASS(wxRedirectedIOHandler) + wxDECLARE_NO_COPY_CLASS(wxRedirectedIOHandler); }; #endif // HAS_PIPE_INPUT_STREAM