X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e52f60e65236befe1a509cc3c1823607be0d2b3c..94b49b9303a9fd119e24d1b07263f5bb0643afa5:/src/gtk1/utilsgtk.cpp diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp index 20ad8bc2a2..6f27685f98 100644 --- a/src/gtk1/utilsgtk.cpp +++ b/src/gtk1/utilsgtk.cpp @@ -86,7 +86,6 @@ void wxGetMousePosition( int* x, int* y ) bool wxColourDisplay(void) { - wxFAIL_MSG( "wxColourDisplay always returns TRUE" ); return TRUE; } @@ -212,7 +211,7 @@ void wxDebugMsg( const char *format, ... ) vfprintf( stderr, format, ap ); fflush( stderr ); va_end(ap); -}; +} void wxError( const wxString &msg, const wxString &title ) { @@ -220,7 +219,7 @@ void wxError( const wxString &msg, const wxString &title ) if (!title.IsNull()) fprintf( stderr, "%s ", WXSTRINGCAST(title) ); if (!msg.IsNull()) fprintf( stderr, ": %s", WXSTRINGCAST(msg) ); fprintf( stderr, ".\n" ); -}; +} void wxFatalError( const wxString &msg, const wxString &title ) { @@ -229,7 +228,7 @@ void wxFatalError( const wxString &msg, const wxString &title ) if (!msg.IsNull()) fprintf( stderr, ": %s", WXSTRINGCAST(msg) ); fprintf( stderr, ".\n" ); exit(3); // the same exit code as for abort() -}; +} //------------------------------------------------------------------------ // directory routines @@ -241,7 +240,7 @@ bool wxDirExists( const wxString& dir ) strcpy( buf, WXSTRINGCAST(dir) ); struct stat sbuf; return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE); -}; +} //------------------------------------------------------------------------ // subprocess routines @@ -280,7 +279,7 @@ static void GTK_EndProcessDetector(gpointer data, gint source, delete proc_data; else proc_data->pid = 0; -}; +} long wxExecute( char **argv, bool sync, wxProcess *process ) { @@ -309,6 +308,14 @@ long wxExecute( char **argv, bool sync, wxProcess *process ) else if (pid == 0) { // we're in child close(end_proc_detect[0]); // close reading side + // These three 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 sub- + // process, the "right thing to do" is to start an xterm executing + // it. + close(STDIN_FILENO); + close(STDOUT_FILENO); + close(STDERR_FILENO); #ifdef _AIX execvp ((const char *)*argv, (const char **)argv); @@ -343,7 +350,7 @@ long wxExecute( char **argv, bool sync, wxProcess *process ) // failed! return pid; } -}; +} long wxExecute( const wxString& command, bool sync, wxProcess *process ) { @@ -365,4 +372,4 @@ long wxExecute( const wxString& command, bool sync, wxProcess *process ) delete [] tmp; return lRc; -}; +}