Restrict the effective range of SIGUSR2 signal.
Restrict the effective range of SIGUSR2 signal.

Hi,

If a cgrulesengd daemon receives a SIGUSR2 signal (for reloading rules
configuration) while waiting in select(), a daemon finishes incorrectly
due to an "Interrupted system call" error.
If applying a patch "Add the strings of errno to cgrulesengd daemon's
message." and running `service cgred reload`, you can see the message
"selecting error: Interrupted system call". This patch fixes the problem.

There were some problems the deadlock happens related to a SIGUSR2 signal
and they have been fixed by the followings already:

* [PATCH] Fix the deadlock of vsyslog() call.
  http://libcg.git.sourceforge.net/git/gitweb.cgi?p=libcg;a=commit;h=70111cd03653c3ceab9d907c14fa35e5881b2735
* [PATCH] Fix the deadlock of rl_lock.
  http://libcg.git.sourceforge.net/git/gitweb.cgi?p=libcg;a=commit;h=0241c6f1df5068c006f756005c8e7faa63058c27

The above two patches fixed the problems by protecting the important
codes from receiving a SIGUSR2 signal. But this way was not good, because
the protecting code will be necessary if increasing the important codes.

Instead of protecting the important codes, this patch restricts the
effective range of receiving SIGUSR2 signal. So we will not need to add
a new protecting code by this patch.

Thanks
Ken'ichi Ohmichi

Signed-off-by: Ken'ichi Ohmichi <68bd1b94aa1af06f94242affe698ebc3cee73fec@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <9e8a88f272eaf8af1eb7757146d1fb3d7f128182@linux.vnet.ibm.com>

rafalmiel/libcg,rafalmiel/libcg,jrfastab/Linux-cgdcbxd,rafalmiel/libcg,jrfastab/Linux-cgdcbxd,rafalmiel/libcg,jrfastab/Linux-cgdcbxd,jrfastab/Linux-cgdcbxd