From 6c2649ab27f96dcc40a1f01a36a07d1603f39c51 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 27 Feb 2012 23:12:56 +0100 Subject: Add timeout to task queue --- src/fastd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/fastd.c') diff --git a/src/fastd.c b/src/fastd.c index b76216c..b5036b4 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -99,7 +99,8 @@ static void configure(fastd_context *ctx, fastd_config *conf) { ctx->peers = NULL; fastd_peer **current_peer = &ctx->peers; - for (fastd_peer_config *peer_conf = conf->peers; peer_conf; peer_conf = peer_conf->next) { + fastd_peer_config *peer_conf; + for (peer_conf = conf->peers; peer_conf; peer_conf = peer_conf->next) { *current_peer = malloc(sizeof(fastd_peer)); (*current_peer)->next = NULL; (*current_peer)->config = peer_conf; @@ -187,7 +188,7 @@ static void handle_input(fastd_context *ctx) { fds[1].fd = ctx->sockfd; fds[1].events = POLLIN; - int ret = poll(fds, 2, -1); + int ret = poll(fds, 2, fastd_task_timeout(ctx)); if (ret < 0) exit_errno(ctx, "poll"); -- cgit v1.2.3