]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
wxColour source cleaning. Corrections to 'const unsigned char' within wxColour docs.
[wxWidgets.git] / src / unix / utilsunx.cpp
index 072a66b54a7f46a0d12f4e6de428ff1e5191e9cd..62be2565e87cee71380ab24f22c5380056c31245 100644 (file)
@@ -15,8 +15,6 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#include <pwd.h>
-
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -35,6 +33,9 @@
 #include "wx/wfstream.h"
 
 #include "wx/unix/execute.h"
+#include "wx/unix/private.h"
+
+#include <pwd.h>
 
 #if wxUSE_STREAMS
 
     #endif // __BSD__/!__BSD__
 
     #define wxStatfs statfs
+
+    #ifndef HAVE_STATFS_DECL
+        // some systems lack statfs() prototype in the system headers (AIX 4)
+        extern "C" int statfs(const char *path, struct statfs *buf);
+    #endif
 #endif // HAVE_STATFS
 
 #ifdef HAVE_STATVFS
@@ -315,7 +321,11 @@ long wxExecute( const wxString& command, int flags, wxProcess *process )
 
     long lRc;
 #if defined(__DARWIN__)
-    if( (lRc = wxMacExecute(argv, flags, process)) != -1)
+    // wxMacExecute only executes app bundles.
+    // It returns an error code if the target is not an app bundle, thus falling
+    // through to the regular wxExecute for non app bundles.
+    lRc = wxMacExecute(argv, flags, process);
+    if( lRc != ((flags & wxEXEC_SYNC) ? -1 : 0))
         return lRc;
 #endif
 
@@ -416,8 +426,10 @@ bool wxPipeInputStream::CanRead() const
     const int fd = m_file->fd();
 
     fd_set readfds;
-    FD_ZERO(&readfds);
-    FD_SET(fd, &readfds);
+
+    wxFD_ZERO(&readfds);
+    wxFD_SET(fd, &readfds);
+
     switch ( select(fd + 1, &readfds, NULL, NULL, &tv) )
     {
         case -1:
@@ -445,13 +457,7 @@ bool wxPipeInputStream::CanRead() const
 // wxExecute: the real worker function
 // ----------------------------------------------------------------------------
 
-#ifdef __VMS
-    #pragma message disable codeunreachable
-#endif
-               
-long wxExecute(wxChar **argv,
-               int flags,
-               wxProcess *process)
+long wxExecute(wxChar **argv, int flags, wxProcess *process)
 {
     // for the sync execution, we return -1 to indicate failure, but for async
     // case we return 0 which is never a valid PID
@@ -600,7 +606,7 @@ long wxExecute(wxChar **argv,
         }
 
         execvp (*mb_argv, mb_argv);
-       
+
         fprintf(stderr, "execvp(");
         // CS changed ppc to ppc_ as ppc is not available under mac os CW Mach-O
         for ( char **ppc_ = mb_argv; *ppc_; ppc_++ )
@@ -668,12 +674,10 @@ long wxExecute(wxChar **argv,
         return traits->WaitForChild(execData);
     }
 
+#if !defined(__VMS) && !defined(__INTEL_COMPILER)
     return ERROR_RETURN_CODE;
-}
-
-#ifdef __VMS
-    #pragma message enable codeunreachable
 #endif
+}
 
 #undef ERROR_RETURN_CODE
 #undef ARGS_CLEANUP