mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/pcntl: pcntl affinity improves EINVAL handling in both cases. (#13907)
also disable tests on travis.
This commit is contained in:
@@ -1516,6 +1516,9 @@ PHP_FUNCTION(pcntl_getcpuaffinity)
|
||||
case EPERM:
|
||||
php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges");
|
||||
break;
|
||||
case EINVAL:
|
||||
zend_value_error("invalid cpu affinity mask size");
|
||||
RETURN_THROWS();
|
||||
default:
|
||||
php_error_docref(NULL, E_WARNING, "Error %d", errno);
|
||||
}
|
||||
@@ -1597,6 +1600,9 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
|
||||
case EPERM:
|
||||
php_error_docref(NULL, E_WARNING, "Calling process not having the proper privileges");
|
||||
break;
|
||||
case EINVAL:
|
||||
zend_argument_value_error(2, "invalid cpu affinity mask size or unmapped cpu id(s)");
|
||||
RETURN_THROWS();
|
||||
default:
|
||||
php_error_docref(NULL, E_WARNING, "Error %d", errno);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ pcntl
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity is not available");
|
||||
if (getenv('TRAVIS')) die('skip Currently fails on Travis');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user