~vapier/libnih/libnih

Viewing all changes in revision 1056.

  • Committer: Mike Frysinger
  • Author(s): Mike Frysinger
  • Date: 2015-05-21 08:12:11 UTC
  • Revision ID: vapier@gentoo.org-20150521081211-428bvcdet7iamkk7
fix race in signal processing leading to lost signals

The current loop will walk all signals one by one and run the handler
for it if any signals were pending.  Then it clears the array.  But if
a signal comes in for an earlier checked signal, it will get clobbered
when the final clear runs.

Change the logic so that we only clear entries for signals whose handler
we explicitly call.  If a different signal comes in, we'll process it
the next time around.

This was discovered & triaged by Jeffy Chen from Rockchip.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: