Merge conflict

This commit is contained in:
Arun M 2018-12-31 17:43:15 +05:30
commit 7ebcd80c05

View File

@ -217,7 +217,7 @@ namespace util
* Second element is the write descriptor of pipe. * Second element is the write descriptor of pipe.
*/ */
static inline static inline
std::pair<int, int> pipe_cloexec() throw (OSError) std::pair<int, int> pipe_cloexec() noexcept(false)
{ {
int pipe_fds[2]; int pipe_fds[2];
int res = pipe(pipe_fds); int res = pipe(pipe_fds);
@ -608,7 +608,7 @@ public:
preexec_func() {} preexec_func() {}
template <typename Func> template <typename Func>
preexec_func(Func f): holder_(new FuncHolder<Func>(f)) preexec_func(Func f): holder_(new FuncHolder<Func>(std::move(f)))
{} {}
void operator()() { void operator()() {
@ -621,8 +621,8 @@ private:
}; };
template <typename T> template <typename T>
struct FuncHolder: HolderBase { struct FuncHolder: HolderBase {
FuncHolder(T func): func_(func) {} FuncHolder(T func): func_(std::move(func)) {}
void operator()() const override {} void operator()() const override { func_(); }
// The function pointer/reference // The function pointer/reference
T func_; T func_;
}; };
@ -965,15 +965,15 @@ public:
if (!defer_process_start_) execute_process(); if (!defer_process_start_) execute_process();
} }
void start_process() throw (CalledProcessError, OSError); void start_process() noexcept(false);
int pid() const noexcept { return child_pid_; } int pid() const noexcept { return child_pid_; }
int retcode() const noexcept { return retcode_; } int retcode() const noexcept { return retcode_; }
int wait() throw(OSError); int wait() noexcept(false);
int poll() throw(OSError); int poll() noexcept(false);
// Does not fail, Caller is expected to recheck the // Does not fail, Caller is expected to recheck the
// status with a call to poll() // status with a call to poll()
@ -1022,7 +1022,7 @@ private:
void init_args(F&& farg, Args&&... args); void init_args(F&& farg, Args&&... args);
void init_args(); void init_args();
void populate_c_argv(); void populate_c_argv();
void execute_process() throw (CalledProcessError, OSError); void execute_process() noexcept(false);
private: private:
detail::Streams stream_; detail::Streams stream_;
@ -1071,7 +1071,7 @@ inline void Popen::populate_c_argv()
cargv_.push_back(nullptr); cargv_.push_back(nullptr);
} }
inline void Popen::start_process() throw (CalledProcessError, OSError) inline void Popen::start_process() noexcept(false)
{ {
// The process was started/tried to be started // The process was started/tried to be started
// in the constructor itself. // in the constructor itself.
@ -1085,7 +1085,7 @@ inline void Popen::start_process() throw (CalledProcessError, OSError)
execute_process(); execute_process();
} }
inline int Popen::wait() throw (OSError) inline int Popen::wait() noexcept(false)
{ {
int ret, status; int ret, status;
std::tie(ret, status) = util::wait_for_child_exit(pid()); std::tie(ret, status) = util::wait_for_child_exit(pid());
@ -1100,7 +1100,7 @@ inline int Popen::wait() throw (OSError)
return 0; return 0;
} }
inline int Popen::poll() throw (OSError) inline int Popen::poll() noexcept(false)
{ {
int status; int status;
if (!child_created_) return -1; // TODO: ?? if (!child_created_) return -1; // TODO: ??
@ -1142,7 +1142,7 @@ inline void Popen::kill(int sig_num)
} }
inline void Popen::execute_process() throw (CalledProcessError, OSError) inline void Popen::execute_process() noexcept(false)
{ {
int err_rd_pipe, err_wr_pipe; int err_rd_pipe, err_wr_pipe;
std::tie(err_rd_pipe, err_wr_pipe) = util::pipe_cloexec(); std::tie(err_rd_pipe, err_wr_pipe) = util::pipe_cloexec();