removed stdin_handle, not necessary

documentation
This commit is contained in:
isanae
2020-12-03 17:44:52 -05:00
parent 2f4cd56276
commit 7141859cb2
6 changed files with 319 additions and 45 deletions
+15 -7
View File
@@ -16,6 +16,13 @@ HANDLE get_bit_bucket()
}
process::filter::filter(
std::string_view line, context::reason r, context::level lv,
bool discard)
: line(line), r(r), lv(lv), discard(discard)
{
}
process::impl::impl(const impl& i)
: interrupt(i.interrupt.load())
{
@@ -29,7 +36,6 @@ process::impl& process::impl::operator=(const impl& i)
stdout_pipe = {};
stderr_pipe = {};
stdin_pipe = {};
stdin_handle = {};
return *this;
}
@@ -193,13 +199,13 @@ process& process::external_error_log(const fs::path& p)
return *this;
}
process& process::flags(flags_t f)
process& process::flags(process_flags f)
{
flags_ = f;
return *this;
}
process::flags_t process::flags() const
process::process_flags process::flags() const
{
return flags_;
}
@@ -340,17 +346,19 @@ void process::do_run(const std::string& what)
}
}
handle_ptr std_in;
if (io_.in)
{
impl_.stdin_pipe.reset(new async_pipe_stdin(*cx_));
impl_.stdin_handle = impl_.stdin_pipe->create();
std_in = impl_.stdin_pipe->create();
}
else
{
impl_.stdin_handle.reset(get_bit_bucket());
std_in.reset(get_bit_bucket());
}
si.hStdInput = impl_.stdin_handle.get();
si.hStdInput = std_in.get();
si.dwFlags = STARTF_USESTDHANDLES;
const std::wstring cmd = utf8_to_utf16(this_env::get("COMSPEC"));
@@ -479,7 +487,7 @@ void process::read_pipe(
if (s.filter)
{
s.filter(f);
if (f.ignore)
if (f.discard)
return;
}
+301 -34
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -142,7 +142,7 @@ void cmake::do_generate()
}
if (!prefix_.empty())
p.arg("-DCMAKE_INSTALL_PREFIX=", prefix_, process::nospace);
p.arg("-DCMAKE_INSTALL_PREFIX=", prefix_);
for (auto&& [name, value] : def_)
p.arg("-D" + name + "=" + value + "");
+1 -1
View File
@@ -55,7 +55,7 @@ void jom::do_run()
{
process p;
process::flags_t pflags = process::terminate_on_interrupt;
auto pflags = process::terminate_on_interrupt;
if (flags_ & allow_failure)
{
p.stderr_level(context::level::trace);
+1 -1
View File
@@ -137,7 +137,7 @@ void msbuild::do_run(const std::vector<std::string>& targets)
plat = platform_;
}
process::flags_t pflags = process::noflags;
auto pflags = process::noflags;
process p;
if (is_set(flags_, allow_failure))
-1
View File
@@ -3,7 +3,6 @@
#include "net.h"
#include "core/conf.h"
#include "core/op.h"
#include "core/process.h"
#include "core/context.h"
namespace mob