Skip to content

Commit 7ebcd80

Browse files
committed
Merge conflict
2 parents ced3d53 + 0894e7f commit 7ebcd80

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

subprocess.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace util
217217
* Second element is the write descriptor of pipe.
218218
*/
219219
static inline
220-
std::pair<int, int> pipe_cloexec() throw (OSError)
220+
std::pair<int, int> pipe_cloexec() noexcept(false)
221221
{
222222
int pipe_fds[2];
223223
int res = pipe(pipe_fds);
@@ -608,7 +608,7 @@ class preexec_func
608608
preexec_func() {}
609609

610610
template <typename Func>
611-
preexec_func(Func f): holder_(new FuncHolder<Func>(f))
611+
preexec_func(Func f): holder_(new FuncHolder<Func>(std::move(f)))
612612
{}
613613

614614
void operator()() {
@@ -621,8 +621,8 @@ class preexec_func
621621
};
622622
template <typename T>
623623
struct FuncHolder: HolderBase {
624-
FuncHolder(T func): func_(func) {}
625-
void operator()() const override {}
624+
FuncHolder(T func): func_(std::move(func)) {}
625+
void operator()() const override { func_(); }
626626
// The function pointer/reference
627627
T func_;
628628
};
@@ -965,15 +965,15 @@ class Popen
965965
if (!defer_process_start_) execute_process();
966966
}
967967

968-
void start_process() throw (CalledProcessError, OSError);
968+
void start_process() noexcept(false);
969969

970970
int pid() const noexcept { return child_pid_; }
971971

972972
int retcode() const noexcept { return retcode_; }
973973

974-
int wait() throw(OSError);
974+
int wait() noexcept(false);
975975

976-
int poll() throw(OSError);
976+
int poll() noexcept(false);
977977

978978
// Does not fail, Caller is expected to recheck the
979979
// status with a call to poll()
@@ -1022,7 +1022,7 @@ class Popen
10221022
void init_args(F&& farg, Args&&... args);
10231023
void init_args();
10241024
void populate_c_argv();
1025-
void execute_process() throw (CalledProcessError, OSError);
1025+
void execute_process() noexcept(false);
10261026

10271027
private:
10281028
detail::Streams stream_;
@@ -1071,7 +1071,7 @@ inline void Popen::populate_c_argv()
10711071
cargv_.push_back(nullptr);
10721072
}
10731073

1074-
inline void Popen::start_process() throw (CalledProcessError, OSError)
1074+
inline void Popen::start_process() noexcept(false)
10751075
{
10761076
// The process was started/tried to be started
10771077
// in the constructor itself.
@@ -1085,7 +1085,7 @@ inline void Popen::start_process() throw (CalledProcessError, OSError)
10851085
execute_process();
10861086
}
10871087

1088-
inline int Popen::wait() throw (OSError)
1088+
inline int Popen::wait() noexcept(false)
10891089
{
10901090
int ret, status;
10911091
std::tie(ret, status) = util::wait_for_child_exit(pid());
@@ -1100,7 +1100,7 @@ inline int Popen::wait() throw (OSError)
11001100
return 0;
11011101
}
11021102

1103-
inline int Popen::poll() throw (OSError)
1103+
inline int Popen::poll() noexcept(false)
11041104
{
11051105
int status;
11061106
if (!child_created_) return -1; // TODO: ??
@@ -1142,7 +1142,7 @@ inline void Popen::kill(int sig_num)
11421142
}
11431143

11441144

1145-
inline void Popen::execute_process() throw (CalledProcessError, OSError)
1145+
inline void Popen::execute_process() noexcept(false)
11461146
{
11471147
int err_rd_pipe, err_wr_pipe;
11481148
std::tie(err_rd_pipe, err_wr_pipe) = util::pipe_cloexec();

0 commit comments

Comments
 (0)