-
Notifications
You must be signed in to change notification settings - Fork 7.8k
ext/sockets/tests/mcast_ipv6_*.phpt: suppress no-ipv6 warning #11651
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
ext/sockets/tests/mcast_ipv6_*.phpt: suppress no-ipv6 warning #11651
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); | ||
// hide the output from socket_create() because it can raise | ||
// a warning if (for example) the linux kernel is lacking ipv6 | ||
@$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); | |
$s = @socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); |
Nit, same in the other files.
// a warning if (for example) the linux kernel is lacking ipv6 | ||
@$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); | ||
if ($s === false) { | ||
die("skip unable to create socket"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
die("skip unable to create socket"); | |
die("skip unable to create socket"); |
Nit. Yes, I see the existing code above uses 2 but we still use 4 everywhere else 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, fixed, thanks!
945b34b
to
f70cb96
Compare
These three tests try to create an ipv6 socket with socket_create() to determine if they should be skipped. On certain systems lacking ipv6 support, however, the call to socket_create() itself raises a warning: BORK Warning: socket_create(): Unable to create socket [97]: Address family not supported by protocol in ... The output is "borked" because the return value (false) is expected but the text of the warning is not. This commit uses the error control operator (@) to hide the warning. Afterwards the tests are skipped normally on such a system.
f70cb96
to
8841bb0
Compare
Thank you @orlitzky! |
These three tests try to create an ipv6 socket with socket_create() to determine if they should be skipped. On certain systems lacking ipv6 support, however, the call to socket_create() itself raises a warning:
BORK Warning: socket_create(): Unable to create socket [97]: Address
family not supported by protocol in ...
The output is "borked" because the return value (false) is expected but the text of the warning is not. This commit uses the error control operator (@) to hide the warning. Afterwards the tests are skipped normally on such a system.