浏览代码

HPCC-9226 Fix build break on Centos

Seems execvpe is not always available.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 年之前
父节点
当前提交
4573c92300
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      system/jlib/jutil.cpp

+ 2 - 3
system/jlib/jutil.cpp

@@ -1540,17 +1540,16 @@ bool callExternalProgram(const char *progname, const StringBuffer &input, String
         pipe2.CloseRead();
         pipe2.SetStdout();
 
-        const char *cmd[] = { progname, NULL };
         if (env_in)
         {
             const char **envp = (const char **) alloca((env_in->ordinality()+1) * sizeof(const char *));
             ForEachItemIn(index, *env_in)
                 envp[index]=env_in->item(index);
             envp[env_in->ordinality()] = NULL;
-            execvpe(progname, (char * const *)cmd, (char * const *)envp);  // will not return, on success
+            execle(progname, progname, (const char *) NULL, (char * const *)envp);  // will not return, on success
         }
         else
-            execvp(progname, (char * const *)cmd);  // will not return, on success
+            execlp(progname, progname, (const char *) NULL);  // will not return, on success
         _exit(EXIT_FAILURE); // must be _exit!!
     }
     else