If the default writer is used because no --writer option was given,
a->num_writers is zero although we have one (the default) writer.
Handle this case correctly to avoid starting the receiver too early.
for (i = 0; i < a->num_filters; i++)
if (s->fns && s->fns[i].task.error != -E_TASK_UNREGISTERED)
return false;
- for (i = 0; i < a->num_writers; i++)
- if (s->wns && s->wns[i].task.error != -E_TASK_UNREGISTERED)
+ if (a->num_writers > 0) {
+ for (i = 0; i < a->num_writers; i++)
+ if (s->wns && s->wns[i].task.error != -E_TASK_UNREGISTERED)
+ return false;
+ } else {
+ if (s->wns && s->wns[0].task.error != -E_TASK_UNREGISTERED)
return false;
+ }
PARA_INFO_LOG("closing slot %d\n", slot_num);
close_writers(s);
_close_filters(s);