瀏覽代碼

Merge pull request #967 from afishbeck/win_exec

Use _spawnvp instead of _execvp on windows for ecl command line

Reviewed-By: Richard Chapman <rchapman@hpccssytems.com>
Richard Chapman 13 年之前
父節點
當前提交
3481b9ac67
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      ecl/eclcmd/eclcmd_shell.cpp

+ 5 - 2
ecl/eclcmd/eclcmd_shell.cpp

@@ -34,9 +34,7 @@
 //=========================================================================================
 
 #ifdef _WIN32
-//TODO - move to or use existing jlib
 #include "process.h"
-#define _execvp execvp
 #endif
 
 int EclCMDShell::callExternal(ArgvIterator &iter)
@@ -51,7 +49,12 @@ int EclCMDShell::callExternal(ArgvIterator &iter)
     for (; !iter.done(); iter.next())
         argv[i++]=iter.query();
     argv[i]=NULL;
+//TODO - add common routine or use existing in jlib
+#ifdef _WIN32
+    if (_spawnvp(_P_WAIT, cmdstr.str(), const_cast<char **>(argv))==-1)
+#else
     if (execvp(cmdstr.str(), const_cast<char **>(argv))==-1)
+#endif
     {
         switch(errno)
         {