| 559 | } |
| 560 | |
| 561 | bool WriteToConsole(const std::string &command) |
| 562 | { |
| 563 | constexpr auto STDIN_FD{ 0 }; |
| 564 | |
| 565 | for (auto c : command) |
| 566 | { |
| 567 | if (::ioctl(STDIN_FD, TIOCSTI, &c) < 0) |
| 568 | { |
| 569 | perror("ioctl"); |
| 570 | return false; |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | char NEW_LINE = '\n'; |
| 575 | ::ioctl(STDIN_FD, TIOCSTI, &NEW_LINE); |
| 576 | |
| 577 | return true; |
| 578 | } |
| 579 | |
| 580 | BOOL ConsoleCtrlHandler(DWORD) |
| 581 | { |
no outgoing calls
no test coverage detected