]> granicus.if.org Git - php/commitdiff
Fix #72676: Test cli_process_title_unix fails on AIX
authorChristoph M. Becker <cmb@php.net>
Thu, 28 Jul 2016 14:49:45 +0000 (16:49 +0200)
committerChristoph M. Becker <cmb@php.net>
Thu, 28 Jul 2016 14:51:45 +0000 (16:51 +0200)
Patch provided by matthieu dot sarter dot external at atos dot net.

sapi/cli/tests/cli_process_title_unix.phpt

index c2632704c559ef30a0ae8f604413d713d43b6488..659299c1fcfd64d7a6aa7cf8793168a8fb9e02d0 100644 (file)
@@ -15,7 +15,12 @@ $pid = getmypid();
 if (cli_set_process_title($original_title) === true)
   echo "Successfully set title\n";
 
-$ps_output = shell_exec("ps -p $pid -o command | tail -n 1");
+$ps_process_title_field = "command";
+if (strtoupper(substr(PHP_OS, 0, 3)) == "AIX")
+{
+  $ps_process_title_field = "args";
+}
+$ps_output = shell_exec("ps -p $pid -o $ps_process_title_field | tail -n 1");
 
 if ($ps_output === null)
 {