Skip to content

Commit a346914

Browse files
committed
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.
1 parent 69b608c commit a346914

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/pcntl/tests/pcntl_setpriority_basic.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Er Galvão Abbott [email protected]
55
# TestFest 2017 PHPRS PHP UG 2017-10-31
66
--SKIPIF--
77
<?php
8-
if (!isset($_SERVER['SUDO_USER'])) {
9-
die('skip - this functions needs to run with superuser');
10-
}
11-
128
if (!extension_loaded('pcntl')) {
13-
die('skip - ext/pcntl not loaded');
14-
} else if (!function_exists('pcntl_setpriority')) {
15-
die('skip - pcntl_setpriority doesn\'t exist');
9+
die('skip ext/pcntl not loaded');
10+
}
11+
if (!function_exists('pcntl_setpriority')) {
12+
die('skip pcntl_setpriority doesn\'t exist');
13+
}
14+
if (!function_exists('posix_getuid') || posix_getuid() !== 0) {
15+
die('skip this functions needs to run with superuser');
1616
}
1717
?>
1818
--FILE--

0 commit comments

Comments
 (0)