Skip to content

Commit fd570fb

Browse files
authored
main/streams: Voidify statbuf_from_array() (#15319)
It always returned SUCCESS
1 parent c426157 commit fd570fb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

main/streams/userspace.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
798798

799799
/* parse the return value from one of the stat functions and store the
800800
* relevant fields into the statbuf provided */
801-
static int statbuf_from_array(zval *array, php_stream_statbuf *ssb)
801+
static void statbuf_from_array(zval *array, php_stream_statbuf *ssb)
802802
{
803803
zval *elem;
804804

@@ -832,7 +832,6 @@ static int statbuf_from_array(zval *array, php_stream_statbuf *ssb)
832832

833833
#undef STAT_PROP_ENTRY
834834
#undef STAT_PROP_ENTRY_EX
835-
return SUCCESS;
836835
}
837836

838837
static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb)
@@ -848,8 +847,8 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb)
848847
call_result = call_method_if_exists(&us->object, &func_name, &retval, 0, NULL);
849848

850849
if (call_result == SUCCESS && Z_TYPE(retval) == IS_ARRAY) {
851-
if (SUCCESS == statbuf_from_array(&retval, ssb))
852-
ret = 0;
850+
statbuf_from_array(&retval, ssb);
851+
ret = 0;
853852
} else {
854853
if (call_result == FAILURE) {
855854
php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!",
@@ -1287,8 +1286,8 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i
12871286

12881287
if (call_result == SUCCESS && Z_TYPE(zretval) == IS_ARRAY) {
12891288
/* We got the info we needed */
1290-
if (SUCCESS == statbuf_from_array(&zretval, ssb))
1291-
ret = 0;
1289+
statbuf_from_array(&zretval, ssb);
1290+
ret = 0;
12921291
} else {
12931292
if (call_result == FAILURE) {
12941293
php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!",

0 commit comments

Comments
 (0)