Skip to content

Commit

Permalink
Be even more gentile while addressing signals. Could fix #17225
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Mar 15, 2010
1 parent 00ac3b1 commit 5836cc3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions System/Daemon.php
Expand Up @@ -488,12 +488,14 @@ static public function start()
}
// Same goes for POSIX signals. Not all Constants are available on
// all platforms.
foreach (self::$_sigHandlers as $phpConstant => $sdLevel) {
if (!is_numeric($phpConstant)) {
if (defined($phpConstant)) {
self::$_sigHandlers[constant($phpConstant)] = $sdLevel;
foreach (self::$_sigHandlers as $signal => $handler) {
if (!$signal) {
unset(self::$_sigHandlers[$signal]);
} else if (is_string($signal)) {
if (defined($signal)) {
self::$_sigHandlers[constant($signal)] = $handler;
}
unset(self::$_sigHandlers[$phpConstant]);
unset(self::$_sigHandlers[$signal]);
}
}

Expand Down

0 comments on commit 5836cc3

Please sign in to comment.