From 616c87c9b772f0865726d6171655e0b94217316a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Wed, 10 Feb 1999 11:19:10 +0000 Subject: [PATCH] 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 --- src/gtk/utilsgtk.cpp | 6 ++++++ src/gtk1/utilsgtk.cpp | 6 ++++++ 2 files changed, 12 insertions(+) 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); -- 2.45.2