com php-src: Fix potentially borked test case: ext/sockets/test s/mcast_ipv4_recv.phpt
| From: | Christoph Michael Becker | Date: | Sat, 12 Oct 2019 14:48:45 +0000 |
| Subject: | com php-src: Fix potentially borked test case: ext/sockets/test s/mcast_ipv4_recv.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108900@lists.php.net to get a copy of this message | ||
Commit: cc8739cfb90abd957d4fa7554e423da308a998c5
Author: Christoph M. Becker <cmbecker69@gmx.de> Sat, 12 Oct 2019 16:48:08 +0200
Parents: 52f0610b7441fe3d341236f5f8bc80d98620a421
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc8739cfb90abd957d4fa7554e423da308a998c5
Log:
Fix potentially borked test case
If interface 'lo' is not available,
socket_set_option() may warn,
which would cause the test to be marked as borked. Thus we silence the
function call.
Changed paths:
M ext/sockets/tests/mcast_ipv4_recv.phpt
Diff:
diff --git a/ext/sockets/tests/mcast_ipv4_recv.phpt b/ext/sockets/tests/mcast_ipv4_recv.phpt
index f56b21a2fab..aef566e9157 100644
--- a/ext/sockets/tests/mcast_ipv4_recv.phpt
+++ b/ext/sockets/tests/mcast_ipv4_recv.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded('sockets')) {
if (getenv('SKIP_ONLINE_TESTS')) die('skip online test');
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$br = socket_bind($s, '0.0.0.0', 3000);
-$so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(
+$so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(
"group" => '224.0.0.23',
"interface" => 'lo',
));