diff options
author | Hannes Magnusson <bjori@php.net> | 2012-03-24 17:58:40 +0100 |
---|---|---|
committer | Hannes Magnusson <bjori@php.net> | 2012-03-24 17:58:40 +0100 |
commit | 948d326b294becccf1e1a34851bce380f2381b96 (patch) | |
tree | 2201c12a7a29f4fe8a8b78e13c1ea88ed491e4fa | |
parent | 4fc4dd8760ddd8a53df9b59921093cc6b523154e (diff) | |
download | php-git-948d326b294becccf1e1a34851bce380f2381b96.tar.gz |
Fix test on FreeBSD and other systems that have /etc/services
-rw-r--r-- | ext/standard/tests/general_functions/getservbyport_basic.phpt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/tests/general_functions/getservbyport_basic.phpt b/ext/standard/tests/general_functions/getservbyport_basic.phpt index 1695455ab1..b9e0f83c98 100644 --- a/ext/standard/tests/general_functions/getservbyport_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyport_basic.phpt @@ -7,8 +7,9 @@ Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) --FILE-- <?php - if(stristr(PHP_OS, "linux")) $file = "/etc/services"; - elseif(stristr(PHP_OS, "Darwin")) $file = "/etc/services"; + if (file_exists("/etc/services")) { + $file = "/etc/services"; + } elseif(substr(PHP_OS,0,3) == "WIN") $file = "C:/WINDOWS/system32/drivers/etc/services"; else die(PHP_OS. " unsupported"); |