Skip to content

main/streams: Voidify statbuf_from_array() #15319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2024
Merged
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
11 changes: 5 additions & 6 deletions main/streams/userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when

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

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

#undef STAT_PROP_ENTRY
#undef STAT_PROP_ENTRY_EX
return SUCCESS;
}

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

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

if (call_result == SUCCESS && Z_TYPE(zretval) == IS_ARRAY) {
/* We got the info we needed */
if (SUCCESS == statbuf_from_array(&zretval, ssb))
ret = 0;
statbuf_from_array(&zretval, ssb);
ret = 0;
} else {
if (call_result == FAILURE) {
php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!",
Expand Down
Loading