Skip to content

Commit 26d6bb3

Browse files
authored
Remove useless duplicated call to php_stream_parse_fopen_modes (#12059)
1 parent c934e24 commit 26d6bb3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

main/streams/streams.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,12 +1602,10 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de
16021602
* read buffer is empty: we can use copy_file_range() */
16031603
int src_fd, dest_fd, dest_open_flags = 0;
16041604

1605-
/* get dest open flags to check if the stream is open in append mode */
1606-
php_stream_parse_fopen_modes(dest->mode, &dest_open_flags);
1607-
16081605
/* copy_file_range does not work with O_APPEND */
16091606
if (php_stream_cast(src, PHP_STREAM_AS_FD, (void*)&src_fd, 0) == SUCCESS &&
16101607
php_stream_cast(dest, PHP_STREAM_AS_FD, (void*)&dest_fd, 0) == SUCCESS &&
1608+
/* get dest open flags to check if the stream is open in append mode */
16111609
php_stream_parse_fopen_modes(dest->mode, &dest_open_flags) == SUCCESS &&
16121610
!(dest_open_flags & O_APPEND)) {
16131611

0 commit comments

Comments
 (0)