]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
just some code cleanup: removed m_hwnd macro
[wxWidgets.git] / src / unix / utilsunx.cpp
index 8336c2d68b11f7e815c6bb404d6e301c7bc2bc33..4d670f4ea0ef2ddfac9726f33f3c006b6279eb2e 100644 (file)
@@ -237,6 +237,12 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags)
 
 #define WXEXECUTE_NARGS   127
 
+#if defined(__DARWIN__)
+long wxMacExecute(wxChar **argv,
+               int flags,
+               wxProcess *process);
+#endif
+
 long wxExecute( const wxString& command, int flags, wxProcess *process )
 {
     wxCHECK_MSG( !command.empty(), 0, wxT("can't exec empty command") );
@@ -307,8 +313,18 @@ long wxExecute( const wxString& command, int flags, wxProcess *process )
     } while(*cptr);
     argv[argc] = NULL;
 
+    long lRc;
+#if defined(__DARWIN__)
+    // 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
+
     // do execute the command
-    long lRc = wxExecute(argv, flags, process);
+    lRc = wxExecute(argv, flags, process);
 
     // clean up
     argc = 0;
@@ -436,7 +452,7 @@ bool wxPipeInputStream::CanRead() const
 #ifdef __VMS
     #pragma message disable codeunreachable
 #endif
-
+               
 long wxExecute(wxChar **argv,
                int flags,
                wxProcess *process)
@@ -588,7 +604,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_++ )