]> git.saurik.com Git - wxWidgets.git/commitdiff
Modified wxExecute() to close stdin/stdout/stderr.
authorKarsten Ballüder <ballueder@usa.net>
Thu, 10 Dec 1998 11:05:14 +0000 (11:05 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Thu, 10 Dec 1998 11:05:14 +0000 (11:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/utilsgtk.cpp
src/gtk1/utilsgtk.cpp

index 20ad8bc2a2975925dc0f316ce229d09a4ae4ea0f..f0808a23015d1564a680e02375f4ad68159d29ed 100644 (file)
@@ -309,6 +309,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);
index 20ad8bc2a2975925dc0f316ce229d09a4ae4ea0f..f0808a23015d1564a680e02375f4ad68159d29ed 100644 (file)
@@ -309,6 +309,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);