Skip to content

Commit 948d326

Browse files
committed
Fix test on FreeBSD and other systems that have /etc/services
1 parent 4fc4dd8 commit 948d326

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/standard/tests/general_functions/getservbyport_basic.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ Michele Orselli (mo@ideato.it)
77
Simone Gentili (sensorario@gmail.com)
88
--FILE--
99
<?php
10-
if(stristr(PHP_OS, "linux")) $file = "/etc/services";
11-
elseif(stristr(PHP_OS, "Darwin")) $file = "/etc/services";
10+
if (file_exists("/etc/services")) {
11+
$file = "/etc/services";
12+
}
1213
elseif(substr(PHP_OS,0,3) == "WIN") $file = "C:/WINDOWS/system32/drivers/etc/services";
1314
else die(PHP_OS. " unsupported");
1415

0 commit comments

Comments
 (0)