com php-src: Fix test on FreeBSD and other systems that have /etc/services: ext/standard/tests/general_functions/getservbyport_basic. phpt
| From: | Hannes Magnusson | Date: | Sat, 24 Mar 2012 16:58:40 +0000 |
| Subject: | com php-src: Fix test on FreeBSD and other systems that have /etc/services: ext/standard/tests/general_functions/getservbyport_basic. phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-68186@lists.php.net to get a copy of this message | ||
Commit: 948d326b294becccf1e1a34851bce380f2381b96
Author: Hannes Magnusson <bjori@php.net> Sat, 24 Mar 2012 17:58:40 +0100
Parents: 4fc4dd8760ddd8a53df9b59921093cc6b523154e
Branches: PHP-5.3 PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=948d326b294becccf1e1a34851bce380f2381b96
Log:
Fix test on FreeBSD and other systems that have /etc/services
Changed paths:
M ext/standard/tests/general_functions/getservbyport_basic.phpt
Diff:
948d326b294becccf1e1a34851bce380f2381b96
diff --git a/ext/standard/tests/general_functions/getservbyport_basic.phpt
b/ext/standard/tests/general_functions/getservbyport_basic.phpt
index 1695455..b9e0f83 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");