diff --git a/src/util/subprocess.h b/src/util/subprocess.h index b4a99f08990..a0d52b1c19b 100644 --- a/src/util/subprocess.h +++ b/src/util/subprocess.h @@ -738,6 +738,7 @@ private: Popen* popen_ = nullptr; }; +#ifndef __USING_WINDOWS__ /*! * A helper class to Popen. * This takes care of all the fork-exec logic @@ -759,6 +760,7 @@ private: Popen* parent_ = nullptr; int err_wr_pipe_ = -1; }; +#endif // Fwd Decl. class Streams; @@ -930,7 +932,9 @@ class Popen { public: friend struct detail::ArgumentDeducer; +#ifndef __USING_WINDOWS__ friend class detail::Child; +#endif template Popen(std::initializer_list cmd_args, Args&& ...args) @@ -1009,6 +1013,9 @@ private: #ifdef __USING_WINDOWS__ HANDLE process_handle_; std::future cleanup_future_; +#else + // Pid of the child process + int child_pid_ = -1; #endif std::string exe_name_; @@ -1017,9 +1024,6 @@ private: std::vector vargs_; std::vector cargv_; - // Pid of the child process - int child_pid_ = -1; - int retcode_ = -1; }; @@ -1258,8 +1262,8 @@ namespace detail { } - inline void Child::execute_child() { #ifndef __USING_WINDOWS__ + inline void Child::execute_child() { int sys_ret = -1; auto& stream = parent_->stream_; @@ -1319,8 +1323,8 @@ namespace detail { // Calling application would not get this // exit failure _exit (EXIT_FAILURE); -#endif } +#endif inline void Streams::setup_comm_channels()