8182034: os::Posix::is_valid_signal() should, if it uses sigaddset, initialize the signal set

Added missing sigemptyset.

Reviewed-by: kbarrett, clanger
This commit is contained in:
Thomas Stuefe 2017-06-13 08:09:17 +02:00
parent ec241eb2a4
commit 7c972a103a

View File

@ -760,6 +760,7 @@ bool os::Posix::is_valid_signal(int sig) {
#else
// Use sigaddset to check for signal validity.
sigset_t set;
sigemptyset(&set);
if (sigaddset(&set, sig) == -1 && errno == EINVAL) {
return false;
}