diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-24 12:19:24 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-24 14:46:25 +0200 |
| commit | a3469146d49027fe0260c7d3c642c4b37a5e032f (patch) | |
| tree | 158e3800946d0cc33c1277e3538266e724b4f4d7 | |
| parent | 69b608cf13f24f7859e564254263fa789e722211 (diff) | |
| download | php-git-a3469146d49027fe0260c7d3c642c4b37a5e032f.tar.gz | |
Use posix_getuid() to check for root in pcntl_setpriority() test
Using SUDO_USER doesn't seem to work on Travis ARM CI -- I guess
that sudo might be in use without the target being root.
| -rw-r--r-- | ext/pcntl/tests/pcntl_setpriority_basic.phpt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/pcntl/tests/pcntl_setpriority_basic.phpt b/ext/pcntl/tests/pcntl_setpriority_basic.phpt index 1f03fb2dc9..235b0ec9ce 100644 --- a/ext/pcntl/tests/pcntl_setpriority_basic.phpt +++ b/ext/pcntl/tests/pcntl_setpriority_basic.phpt @@ -5,14 +5,14 @@ Er Galvão Abbott galvao@galvao.eti.br # TestFest 2017 PHPRS PHP UG 2017-10-31 --SKIPIF-- <?php -if (!isset($_SERVER['SUDO_USER'])) { - die('skip - this functions needs to run with superuser'); -} - if (!extension_loaded('pcntl')) { - die('skip - ext/pcntl not loaded'); -} else if (!function_exists('pcntl_setpriority')) { - die('skip - pcntl_setpriority doesn\'t exist'); + die('skip ext/pcntl not loaded'); +} +if (!function_exists('pcntl_setpriority')) { + die('skip pcntl_setpriority doesn\'t exist'); +} +if (!function_exists('posix_getuid') || posix_getuid() !== 0) { + die('skip this functions needs to run with superuser'); } ?> --FILE-- |
