Skip to content

Fix #72409 - return previous handler #1985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

bp1222
Copy link
Contributor

@bp1222 bp1222 commented Jul 5, 2016

This patch addresses https://bugs.php.net/bug.php?id=72409

This patch is applied to master compared to PR #1952 which was
patching 5.6.x branch of PHP

This patch takes into account discussions on PR #1978
Addressing that rather than have pcntl_signal() return a value
to create a new function that can be used to get the current
value of the signal handler.

This patch addresses https://bugs.php.net/bug.php?id=72409

This patch is applied to master compared to PR#1952 which was
patching 5.6.x branch of PHP

This patch takes into account discussions on PR php#1978
Addressing that rather than have pcntl_signal() return a value
to create a new function that can be used to get the current
value of the signal handler.
return;
}

if (signo < 1 || signo > 32) {
Copy link
Member

@laruence laruence Jul 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use NSIG instead of hardcode 32

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was copy-pasting that via pcntl_signal(). The problem with using NSIG is that on my box(linux 4.4.0, libc 2.22-4) it's value is 64, however 32 is the largest defined signal. That said, NSIG on FreeBSD is defined to 32, even though it has SIGLIBRT defined at 33. So, I'm not sure what happens if you're to sigaction() a signal that's not defined in signal.h, or if in general we might look to be smarter about what is the highest signal we support per-platform.

Regardless, this could be something addressed in a distinct PR trying to abstract and remove the hard-coded values.

@weltling
Copy link
Contributor

weltling commented Jul 6, 2016

@trowski about the question from the other PR - if this PR gets accepted in 7.1, i don't mind a backport. Though please lets make the gap a bit longer, letting it to go through 7.1 QA first (still it would be beta). Then target 7.0.11 if everything is ok, so merging into 7.0 like after August 4th.

Thanks.

@trowski
Copy link
Member

trowski commented Jul 6, 2016

@weltling Sounds good, thanks!

@php-pulls
Copy link

Comment on behalf of trowski at php.net:

Merged into master and will be included in 7.1.0-beta1. I'll merge the changes down into 7.0 later as suggested.

@php-pulls php-pulls closed this Jul 6, 2016
@bp1222 bp1222 deleted the fix3-74209 branch July 7, 2016 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants