clock: Read fd to avoid 100% cpu usage

In clock_func() it is necessary to read the timer fd, or
it will stay readable, and the event loop will call the function again.
That causes an endless loop.
Kristian Høgsberg 13 years ago
parent fc9c5e04fd
commit 70226bbda6
  1. 2
      clients/desktop-shell.c

@ -318,7 +318,9 @@ clock_func(struct task *task, uint32_t events)
{
struct panel_clock *clock =
container_of(task, struct panel_clock, clock_task);
uint64_t exp;
read(clock->clock_fd, &exp, sizeof exp);
if (panel_clock_tick(clock))
widget_schedule_redraw(clock->widget);
}

Loading…
Cancel
Save