Skip to content

Commit

Permalink
add bash -c for folly::subprocess (vesoft-inc#4676)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperYoko authored Sep 26, 2022
1 parent 450e58e commit a229752
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/hdfs/HdfsCommandHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Status HdfsCommandHelper::ls(const std::string& hdfsHost,
"hdfs dfs -ls hdfs://%s:%d%s", hdfsHost.c_str(), hdfsPort, hdfsPath.c_str());
LOG(INFO) << "Running HDFS Command: " << command;
try {
folly::Subprocess proc(std::vector<std::string>({command}));
folly::Subprocess proc(std::vector<std::string>({"/bin/bash", "-c", command}));
auto result = proc.wait();
if (!result.exited()) {
return Status::Error("Failed to ls hdfs");
Expand All @@ -43,7 +43,7 @@ Status HdfsCommandHelper::copyToLocal(const std::string& hdfsHost,
localPath.c_str());
LOG(INFO) << "Running HDFS Command: " << command;
try {
folly::Subprocess proc(std::vector<std::string>({command}));
folly::Subprocess proc(std::vector<std::string>({"/bin/bash", "-c", command}));
auto result = proc.wait();
if (!result.exited()) {
return Status::Error("Failed to download from hdfs");
Expand Down

0 comments on commit a229752

Please sign in to comment.