Commit e570225e authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

tiny-nghttpd: Simplify timer event handling

parent 8fffa055
......@@ -549,18 +549,12 @@ static int io_loop_run(io_loop *loop, server *serv)
static int handle_timer(io_loop *loop, uint32_t events, void *ptr)
{
timer *tmr = ptr;
char buf[256];
/* We may get more than 8 bytes here? */
for(;;) {
int64_t buf;
ssize_t nread;
while((nread = read(tmr->fd, buf, sizeof(buf))) == -1 && errno == EINTR);
while((nread = read(tmr->fd, &buf, sizeof(buf))) == -1 && errno == EINTR);
if(nread == -1) {
break;
}
}
assert(nread == sizeof(buf));
update_date();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment