1616
1717using namespace srsran ;
1818
19- io_timer_source::io_timer_source (timer_manager& tick_sink_,
20- io_broker& broker_,
21- std::chrono::milliseconds tick_period_) :
22- tick_sink(tick_sink_), broker(broker_), tick_period(tick_period_), logger(srslog::fetch_basic_logger(" IO-EPOLL" ))
19+ io_timer_source::io_timer_source (timer_manager& tick_sink_, io_broker& broker, std::chrono::milliseconds tick_period) :
20+ tick_sink(tick_sink_), logger(srslog::fetch_basic_logger(" IO-EPOLL" ))
2321{
2422 using namespace std ::chrono;
2523
26- timer_fd = unique_fd{timerfd_create (CLOCK_REALTIME, 0 )};
24+ timer_fd = unique_fd{:: timerfd_create (CLOCK_REALTIME, 0 )};
2725 if (not timer_fd.is_open ()) {
2826 report_fatal_error_if_not (" Failed to create timer source (errno={})" , strerror (errno));
2927 }
@@ -32,7 +30,7 @@ io_timer_source::io_timer_source(timer_manager& tick_sink_,
3230 auto tnsecs = duration_cast<nanoseconds>(tick_period) - duration_cast<nanoseconds>(tsecs);
3331 struct timespec period = {tsecs.count (), tnsecs.count ()};
3432 struct itimerspec timerspec = {period, period};
35- timerfd_settime (timer_fd.value (), 0 , &timerspec, nullptr );
33+ :: timerfd_settime (timer_fd.value(), 0, &timerspec, nullptr);
3634
3735 io_sub = broker.register_fd (
3836 timer_fd.value (), [this ]() { read_time (); }, [this ](io_broker::error_code ev) { io_sub.reset (); });
@@ -41,9 +39,9 @@ io_timer_source::io_timer_source(timer_manager& tick_sink_,
4139void io_timer_source::read_time ()
4240{
4341 char read_buffer[8 ];
44- int n = read (timer_fd.value (), read_buffer, sizeof (read_buffer));
42+ int n = :: read (timer_fd.value (), read_buffer, sizeof (read_buffer));
4543 if (n < 0 ) {
46- logger.error (" Failed to read timerfd (errno={})" , strerror (errno));
44+ logger.error (" Failed to read timerfd (errno={})" , :: strerror (errno));
4745 return ;
4846 }
4947 if (n == 0 ) {
0 commit comments