浏览代码

Use execlp() instead of execl()

Tatsuhiro Tsujikawa 13 年之前
父节点
当前提交
f6c7aaa1cd
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/util.cc

+ 6 - 6
src/util.cc

@@ -1514,12 +1514,12 @@ void executeHook
   if(cpid == -1) {
     A2_LOG_ERROR("fork() failed. Cannot execute user command.");
   } else if(cpid == 0) {
-    execl(command.c_str(),
-          command.c_str(),
-          gidStr.c_str(),
-          numFilesStr.c_str(),
-          firstFilename.c_str(),
-          reinterpret_cast<char*>(0));
+    execlp(command.c_str(),
+           command.c_str(),
+           gidStr.c_str(),
+           numFilesStr.c_str(),
+           firstFilename.c_str(),
+           reinterpret_cast<char*>(0));
     perror(("Could not execute user command: "+command).c_str());
     exit(EXIT_FAILURE);
   }