{
using rearm = dasynq::rearm;
- bool expired = false;
+ bool expired;
public:
rearm timer_expiry(eventloop_t &, int expiry_count)
{
return expired;
}
+
+ void reset()
+ {
+ expired = false;
+ }
};
control_socket_watcher control_socket_io;
}
}
+ log_flush_timer.reset();
log_flush_timer.arm_timer_rel(event_loop, timespec{5,0}); // 5 seconds
while (! is_log_flushed() && ! log_flush_timer.has_expired()) {
event_loop.run();
fcntl(STDIN_FILENO, F_SETFL, origFlags | O_NONBLOCK);
do_prompt:
- std::cout << "Please choose: (r)eboot, r(e)covery, re(s)tart boot sequence, (p)ower off?" << std::endl;
+ std::cout << "Choose: (r)eboot, r(e)covery, re(s)tart boot sequence, (p)ower off? " << std::flush;
console_input_io.set_enabled(event_loop, true);
do {
char buf[1];
int r = read(STDIN_FILENO, buf, 1); // read a single character, to make sure we wait for input
if (r == 1) {
+ std::cout << "\n"; // force new line after input
if (buf[0] == 'r' || buf[0] == 'R') {
services->stop_all_services(shutdown_type_t::REBOOT);
}