diff --git a/lib/path.c b/lib/path.c index 165ce740e..bb27f104f 100644 --- a/lib/path.c +++ b/lib/path.c @@ -641,12 +641,18 @@ int path_parse(struct path *p, json_t *cfg, struct vlist *nodes) /* Autodetect whether to use poll() for this path or not */ if (p->poll == -1) { - struct path_source *ps = (struct path_source *) vlist_at(&p->sources, 0); + if (p->rate > 0) + p->poll = 1; + else if (vlist_length(&p->sources) > 1) + p->poll = 1; + else { + struct path_source *ps = (struct path_source *) vlist_at(&p->sources, 0); - int fds[16]; - int num_fds = node_poll_fds(ps->node, fds); + int fds[16]; + int num_fds = node_poll_fds(ps->node, fds); - p->poll = (p->rate > 0 || vlist_length(&p->sources) > 1) && num_fds > 0; + p->poll = num_fds > 0; + } } ret = vlist_destroy(&sources, NULL, false);