Skip to content

Commit 5fcdd24

Browse files
committed
Apply #[\NoDiscard] to flock()
1 parent 6f7aec5 commit 5fcdd24

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,7 @@ function proc_nice(int $priority): bool {}
27322732
* @param resource $stream
27332733
* @param int $would_block
27342734
*/
2735+
#[\NoDiscard(message: "as locking the stream might have failed")]
27352736
function flock($stream, int $operation, &$would_block = null): bool {}
27362737

27372738
/**

ext/standard/basic_functions_arginfo.h

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/standard/tests/file/userstreams_004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class test_wrapper extends test_wrapper_base {
1919
}
2020
function test($name, $fd, $mode) {
2121
echo "------ $name: -------\n";
22-
flock($fd, $mode);
22+
(void)flock($fd, $mode);
2323
$data = stream_get_meta_data($fd);
2424
var_dump($data['wrapper_data']->mode === $mode);
2525
}

0 commit comments

Comments
 (0)