Skip to content

Commit b7256ee

Browse files
jorgsowadevnexen
andauthored
Improve posix_setrlimit() limit error message (#24417)
Co-authored-by: David Carlier <devnexen@gmail.com>
1 parent 8d8029e commit b7256ee

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎ext/posix/posix.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,12 +1235,12 @@ PHP_FUNCTION(posix_setrlimit)
12351235
ZEND_PARSE_PARAMETERS_END();
12361236

12371237
if (!POSIX_RLIM_VALID(cur)) {
1238-
zend_argument_value_error(2, "must be greater or equal to -1");
1238+
zend_argument_value_error(2, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY");
12391239
RETURN_THROWS();
12401240
}
12411241

12421242
if (!POSIX_RLIM_VALID(max)) {
1243-
zend_argument_value_error(3, "must be greater or equal to -1");
1243+
zend_argument_value_error(3, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY");
12441244
RETURN_THROWS();
12451245
}
12461246

‎ext/posix/tests/posix_setrlimit.phpt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ try {
3232
--EXPECT--
3333
bool(true)
3434
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128
35-
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1
36-
ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1
35+
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY
36+
ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY

0 commit comments

Comments
 (0)