mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-05 04:46:21 -04:00
merge
This commit is contained in:
commit
718d0c816a
@ -1,4 +1,4 @@
|
||||
![Subprocessing in C++]
|
||||
## [Subprocessing in C++]
|
||||
|
||||
## Design Goals
|
||||
The only goal was to develop something that is as close as python2.7 subprocess module in dealing with processes.
|
||||
|
@ -674,7 +674,7 @@ struct input
|
||||
}
|
||||
input(IOTYPE typ) {
|
||||
assert (typ == PIPE && "STDOUT/STDERR not allowed");
|
||||
#ifndef _MSC_VER
|
||||
#ifndef _MSC_VER
|
||||
std::tie(rd_ch_, wr_ch_) = util::pipe_cloexec();
|
||||
#endif
|
||||
}
|
||||
@ -1303,7 +1303,10 @@ inline int Popen::wait() noexcept(false)
|
||||
inline int Popen::poll() noexcept(false)
|
||||
{
|
||||
int status;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
if (!child_created_) return -1; // TODO: ??
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
int ret = WaitForSingleObject(process_handle_, 0);
|
||||
@ -1672,12 +1675,11 @@ namespace detail {
|
||||
std::string err_msg(exp.what());
|
||||
//ATTN: Can we do something on error here ?
|
||||
util::write_n(err_wr_pipe_, err_msg.c_str(), err_msg.length());
|
||||
throw;
|
||||
}
|
||||
|
||||
// Calling application would not get this
|
||||
// exit failure
|
||||
exit (EXIT_FAILURE);
|
||||
_exit (EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user