X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=sync_filter.c;h=3174a4ef741b0afe1107ff6bd9146f1c82f5f77e;hb=cdbc8067a2e27ee7f9e0d8ff11cf415603fc0558;hp=f23545adb68342322fbeaef4c45c73c663a969be;hpb=d5e27e2a346da2f18188d317926a60687d082732;p=paraslash.git diff --git a/sync_filter.c b/sync_filter.c index f23545ad..3174a4ef 100644 --- a/sync_filter.c +++ b/sync_filter.c @@ -103,7 +103,7 @@ static void sync_open(struct filter_node *fn) const struct lls_opt_result *r_b; ctx = fn->private_data = para_calloc(sizeof(*ctx)); - INIT_LIST_HEAD(&ctx->buddies); + init_list_head(&ctx->buddies); /* create socket to listen for incoming packets */ ret = makesock( @@ -248,7 +248,7 @@ static void sync_set_timeout(struct sync_filter_context *ctx, tv_add(now, &to, &ctx->timeout); } -static void sync_pre_select(struct sched *s, void *context) +static void sync_pre_monitor(struct sched *s, void *context) { int ret; struct filter_node *fn = context; @@ -261,7 +261,7 @@ static void sync_pre_select(struct sched *s, void *context) ret = btr_node_status(fn->btrn, 0, BTR_NT_INTERNAL); if (ret < 0) return sched_min_delay(s); - para_fd_set(ctx->listen_fd, &s->rfds, &s->max_fileno); + sched_monitor_readfd(ctx->listen_fd, s); if (ret == 0) return; if (ctx->timeout.tv_sec == 0) { /* must ping buddies */ @@ -284,7 +284,7 @@ static struct sync_buddy *sync_find_buddy(struct sockaddr *addr, return NULL; } -static int sync_post_select(__a_unused struct sched *s, void *context) +static int sync_post_monitor(__a_unused struct sched *s, void *context) { int ret; struct filter_node *fn = context; @@ -324,7 +324,7 @@ static int sync_post_select(__a_unused struct sched *s, void *context) } ctx->ping_sent = true; } - if (FD_ISSET(ctx->listen_fd, &s->rfds)) { + if (sched_read_ok(ctx->listen_fd, s)) { char c; for (;;) { struct sockaddr src_addr; @@ -377,8 +377,8 @@ out: const struct filter lsg_filter_cmd_com_sync_user_data = { .setup = sync_setup, .open = sync_open, - .pre_select = sync_pre_select, - .post_select = sync_post_select, + .pre_monitor = sync_pre_monitor, + .post_monitor = sync_post_monitor, .close = sync_close, .teardown = sync_teardown };