a few small changes to fix tests

This commit is contained in:
water
2022-05-03 18:57:59 -04:00
parent d1513bd06b
commit e80a011a86
5 changed files with 17 additions and 9 deletions
+5 -2
View File
@@ -54,8 +54,11 @@ std::optional<std::string> ReplServer::get_msg() {
}
}
// Wait for activity on _something_
auto activity = select(max_sd + 1, &read_sockets, NULL, NULL, NULL);
// Wait for activity on _something_, with a timeout so we don't get stuck here on exit.
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = 100000;
auto activity = select(max_sd + 1, &read_sockets, NULL, NULL, &timeout);
if (activity < 0) { // TODO - || error!
return std::nullopt;