From 9e51ad4a65282b369f9b7880bffe285b1de82bdf Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Wed, 27 Mar 2019 13:49:51 +0800 Subject: [PATCH] fix io and fs compile on mac test=develop --- paddle/fluid/framework/device_worker.h | 2 +- paddle/fluid/framework/io/shell.cc | 4 +++- paddle/fluid/framework/io/shell.h | 1 + paddle/fluid/framework/trainer.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/device_worker.h b/paddle/fluid/framework/device_worker.h index 8e211fcb9d8..2a6c2fa5b38 100644 --- a/paddle/fluid/framework/device_worker.h +++ b/paddle/fluid/framework/device_worker.h @@ -32,7 +32,7 @@ limitations under the License. */ #include "paddle/fluid/framework/variable_helper.h" #include "paddle/fluid/operators/reader/blocking_queue.h" #include "paddle/fluid/platform/place.h" -#includw "paddle/fluid/platform/port.h" +#include "paddle/fluid/platform/port.h" #include "paddle/fluid/platform/timer.h" namespace paddle { diff --git a/paddle/fluid/framework/io/shell.cc b/paddle/fluid/framework/io/shell.cc index a404988bf68..bcfa4f44ff1 100644 --- a/paddle/fluid/framework/io/shell.cc +++ b/paddle/fluid/framework/io/shell.cc @@ -242,7 +242,7 @@ static int shell_p2open_fork_internal(const char* real_cmd, int pipein_fds[2], std::pair, std::shared_ptr> shell_p2open( const std::string& cmd) { #if defined _WIN32 || defined __APPLE__ - return nullptr; + return {}; #else if (shell_verbose()) { LOG(INFO) << "Opening bidirectional pipe[" << cmd << "]"; @@ -315,7 +315,9 @@ std::string shell_get_command_output(const std::string& cmd) { } } } while (err_no == -1); + return ""; #endif } + } // end namespace framework } // end namespace paddle diff --git a/paddle/fluid/framework/io/shell.h b/paddle/fluid/framework/io/shell.h index 22f24adcfd4..7f0da490f87 100644 --- a/paddle/fluid/framework/io/shell.h +++ b/paddle/fluid/framework/io/shell.h @@ -29,6 +29,7 @@ #include #include #include "glog/logging.h" +#include "paddle/fluid/platform/port.h" #include "paddle/fluid/string/string_helper.h" namespace paddle { diff --git a/paddle/fluid/framework/trainer.h b/paddle/fluid/framework/trainer.h index b2cf79531c4..b29736cfbbe 100644 --- a/paddle/fluid/framework/trainer.h +++ b/paddle/fluid/framework/trainer.h @@ -25,12 +25,12 @@ limitations under the License. */ #include "paddle/fluid/framework/data_set.h" #include "paddle/fluid/framework/device_worker.h" #include "paddle/fluid/framework/lod_tensor.h" -#includw "paddle/fluid/platform/port.h" #include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/reader.h" #include "paddle/fluid/framework/trainer_desc.pb.h" #include "paddle/fluid/framework/variable_helper.h" #include "paddle/fluid/operators/reader/blocking_queue.h" +#include "paddle/fluid/platform/port.h" namespace paddle { namespace framework { -- GitLab