Skip to content

Commit

Permalink
#165 Loading from cin broken (#167)
Browse files Browse the repository at this point in the history
Fixed #165
  • Loading branch information
cmannett85 authored Feb 3, 2021
1 parent 6a3fa27 commit a3216af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ void input_handler(virtual_cpu& vcpu,
boost::ignore_unused(bytes_read);

if (ec) {
if (ec != boost::asio::error::operation_aborted) {
if (ec != boost::asio::error::operation_aborted &&
ec != boost::asio::error::eof) {
log::print(log::ERROR, "cin read failure: ", ec.message());
}
return;
Expand Down
3 changes: 1 addition & 2 deletions test/loader_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ BOOST_AUTO_TEST_CASE(load_test)
BOOST_TEST_MESSAGE("From cin");
try {
// Temporarily take control of std::cin
auto orig_rdbuf = std::cin.rdbuf();
auto raii = utility::raii{[orig_rdbuf]() {
auto raii = utility::raii{[orig_rdbuf = std::cin.rdbuf()]() {
std::cin.rdbuf(orig_rdbuf);
}};

Expand Down

0 comments on commit a3216af

Please sign in to comment.