]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
don't mention GUI-only changes in the base section
[wxWidgets.git] / src / unix / utilsunx.cpp
index 6fe5a0b5f74e37b7b2f78739298e162161174e6d..445f88b9faf3ecb6046cd6eeec90bcb51c061056 100644 (file)
@@ -253,11 +253,7 @@ long wxExecute( const wxString& command, int flags, wxProcess *process )
     argv[argc] = NULL;
 
     // do execute the command
-#if wxUSE_UNICODE
-    long lRc = -1;
-#else
     long lRc = wxExecute(argv, flags, process);
-#endif
 
     // clean up
     argc = 0;
@@ -363,7 +359,7 @@ public:
     wxPipeInputStream(int fd) : wxFileInputStream(fd) { }
 
     // return TRUE if the pipe is still opened
-    bool IsOpened() const { return TRUE; } // TODO
+    bool IsOpened() const { return !Eof(); }
 
     // return TRUE if we have anything to read, don't block
     bool IsAvailable() const;
@@ -372,7 +368,7 @@ public:
 bool wxPipeInputStream::IsAvailable() const
 {
     if ( m_lasterror == wxSTREAM_EOF )
-        return TRUE;
+        return FALSE;
 
     // check if there is any input available
     struct timeval tv;
@@ -391,15 +387,17 @@ bool wxPipeInputStream::IsAvailable() const
             // fall through
 
         case 0:
-            return TRUE;
+            return FALSE;
 
         default:
             wxFAIL_MSG(_T("unexpected select() return value"));
             // still fall through
 
         case 1:
-            // input available
-            return TRUE;
+            // input available -- or maybe not, as select() returns 1 when a
+            // read() will complete without delay, but it could still not read
+            // anything
+            return !Eof();
     }
 }
 
@@ -561,13 +559,17 @@ long wxExecute(wxChar **argv,
     }
 
     // fork the process
-#ifdef HAVE_VFORK
-    pid_t pid = vfork();
+    //
+    // NB: do *not* use vfork() here, it completely breaks this code for some
+    //     reason under Solaris (and maybe others, although not under Linux)
+    //     But on OpenVMS we do not have fork so we have to use vfork and
+    //     cross our fingers that it works.
+#ifdef __VMS
+   pid_t pid = vfork();
 #else
-    pid_t pid = fork();
+   pid_t pid = fork();
 #endif
-
-    if ( pid == -1 )     // error?
+   if ( pid == -1 )     // error?
     {
         wxLogSysError( _("Fork failed") );
 
@@ -603,7 +605,7 @@ long wxExecute(wxChar **argv,
             }
         }
 
-#ifndef __VMS
+#if !defined(__VMS) && !defined(__EMX__)
         if ( flags & wxEXEC_MAKE_GROUP_LEADER )
         {
             // Set process group to child process' pid.  Then killing -pid