diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-02-27 23:12:56 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-02-27 23:12:56 +0100 |
commit | 6c2649ab27f96dcc40a1f01a36a07d1603f39c51 (patch) | |
tree | 32e5ddf8ea76619da45cc27578673a15d7399910 /src/fastd.c | |
parent | 5e70122b5481c878aa0773281304c4d68062cf7d (diff) | |
download | fastd-6c2649ab27f96dcc40a1f01a36a07d1603f39c51.tar fastd-6c2649ab27f96dcc40a1f01a36a07d1603f39c51.zip |
Add timeout to task queue
Diffstat (limited to 'src/fastd.c')
-rw-r--r-- | src/fastd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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"); |