synchronous command
This commit is contained in:
parent
ce814e96a6
commit
33e0066b4c
@ -47,6 +47,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
console_consumer console;
|
console_consumer console;
|
||||||
|
mutable std::mutex mtx_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void handle_get_mount(auto &&req, auto &&res) const;
|
void handle_get_mount(auto &&req, auto &&res) const;
|
||||||
|
@ -355,6 +355,7 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
|
|||||||
|
|
||||||
auto cmd_line = fmt::format(R"({} {} {})", repertory_binary_, str_type, args);
|
auto cmd_line = fmt::format(R"({} {} {})", repertory_binary_, str_type, args);
|
||||||
|
|
||||||
|
mutex_lock lock(mtx_);
|
||||||
if (background) {
|
if (background) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
system(fmt::format(R"(start "" /b {})", cmd_line).c_str());
|
system(fmt::format(R"(start "" /b {})", cmd_line).c_str());
|
||||||
@ -378,8 +379,8 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
|
|||||||
|
|
||||||
std::string data;
|
std::string data;
|
||||||
std::array<char, 1024U> buffer{};
|
std::array<char, 1024U> buffer{};
|
||||||
while (feof(pipe) == 0) {
|
while (std::feof(pipe) == 0) {
|
||||||
while (fgets(buffer.data(), buffer.size(), pipe) != nullptr) {
|
while (std::fgets(buffer.data(), buffer.size(), pipe) != nullptr) {
|
||||||
data += buffer.data();
|
data += buffer.data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user