Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/posix/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,13 +1227,13 @@ PHP_FUNCTION(posix_setrlimit)
Z_PARAM_LONG(max)
ZEND_PARSE_PARAMETERS_END();

if (cur < -1) {
zend_argument_value_error(2, "must be greater or equal to -1");
if (cur < -1 && cur != (zend_long) RLIM_INFINITY) {
zend_argument_value_error(2, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY");
RETURN_THROWS();
}

if (max < -1) {
zend_argument_value_error(3, "must be greater or equal to -1");
if (max < -1 && max != (zend_long) RLIM_INFINITY) {
zend_argument_value_error(3, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY");
RETURN_THROWS();
}

Expand Down
4 changes: 2 additions & 2 deletions ext/posix/tests/posix_setrlimit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ try {
--EXPECT--
bool(true)
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1
ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY
ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY
14 changes: 14 additions & 0 deletions ext/posix/tests/posix_setrlimit_infinity.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
posix_setrlimit(): accepts POSIX_RLIMIT_INFINITY
--EXTENSIONS--
posix
--SKIPIF--
<?php
if (!function_exists('posix_setrlimit')) die('skip posix_setrlimit() not found');
?>
--FILE--
<?php
var_dump(is_bool(posix_setrlimit(POSIX_RLIMIT_FSIZE, POSIX_RLIMIT_INFINITY, POSIX_RLIMIT_INFINITY)));
?>
--EXPECT--
bool(true)
7 changes: 6 additions & 1 deletion ext/session/tests/session_write_close_encode_failure.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ session_write_close() closes the save handler when encoding the session data fai
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
<?php
include('skipif.inc');
if (PHP_OS_FAMILY === "Solaris") {
die("skip flock() is emulated with per-process fcntl() locks on Solaris");
}
?>
--INI--
session.use_cookies=0
session.cache_limiter=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if (!function_exists("proc_open")) {
if (!@is_dir("/proc/self/fd")) {
die("skip requires /proc/self/fd");
}
if (PHP_OS_FAMILY === "Solaris") {
die("skip /proc/self/fd entries are not symlinks on Solaris");
}
?>
--FILE--
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if (!function_exists("proc_open")) {
if (!@is_dir("/proc/self/fd")) {
die("skip requires /proc/self/fd");
}
if (PHP_OS_FAMILY === "Solaris") {
die("skip /proc/self/fd entries are not symlinks on Solaris");
}
?>
--FILE--
<?php
Expand Down
Loading