From: Karsten Ballüder Date: Wed, 10 Feb 1999 11:19:10 +0000 (+0000) Subject: small modification to stdin/stdout/stderr behaviour in wxExcute() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/616c87c9b772f0865726d6171655e0b94217316a small modification to stdin/stdout/stderr behaviour in wxExcute() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index f27d96bdf8..543fae806e 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -327,6 +327,12 @@ long wxExecute( char **argv, bool sync, wxProcess *process ) close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); + // some programs complain about sterr not being open, so + // redirect them: + open("/dev/null", O_RDONLY); // stdin + open("/dev/null", O_WRONLY); // stdout + open("/dev/null", O_WRONLY); // stderr + #ifdef _AIX execvp ((const char *)*argv, (const char **)argv); diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp index f27d96bdf8..543fae806e 100644 --- a/src/gtk1/utilsgtk.cpp +++ b/src/gtk1/utilsgtk.cpp @@ -327,6 +327,12 @@ long wxExecute( char **argv, bool sync, wxProcess *process ) close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); + // some programs complain about sterr not being open, so + // redirect them: + open("/dev/null", O_RDONLY); // stdin + open("/dev/null", O_WRONLY); // stdout + open("/dev/null", O_WRONLY); // stderr + #ifdef _AIX execvp ((const char *)*argv, (const char **)argv);