tiny-nghttpd: Simplify timer event handling
This commit is contained in:
parent
8fffa05513
commit
e570225e97
|
@ -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)
|
static int handle_timer(io_loop *loop, uint32_t events, void *ptr)
|
||||||
{
|
{
|
||||||
timer *tmr = ptr;
|
timer *tmr = ptr;
|
||||||
char buf[256];
|
int64_t buf;
|
||||||
|
|
||||||
/* We may get more than 8 bytes here? */
|
|
||||||
for(;;) {
|
|
||||||
ssize_t nread;
|
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) {
|
assert(nread == sizeof(buf));
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
update_date();
|
update_date();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue