Skip to content
  • Philippe Gerum's avatar
    evl/poll: limit clear_wait() to the active watchpoint range · 387050d3
    Philippe Gerum authored
    
    
    Several factors may cause the active watchpoint count to be lesser
    than the poll table size as a result of collecting events:
    
    - a stale file descriptor is encountered (-EBADF)
    - bad user memory is written to while copying back evl_poll_event (-EFAULT)
    - the user event set has fewer entries than the ready set (> 0)
    
    In all of these cases, we may end up watching fewer files than the
    total amount of items in the poll table, in which case poll_context.nr
    is larger than the actual number of active watchpoints.
    
    For this reason, clear_wait() cannot iterate over poll_context.nr
    items, but should rather consider the active watchpoints only. To this
    end, introduce poll_context.active which is set by collect_events()
    appropriately.
    
    Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
    387050d3