Skip to content

Commit bf46492

Browse files
authored
standard/filestats.c: use RETURN_BOOL() when possible (#22876)
1 parent b70e95d commit bf46492

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

ext/standard/filestat.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
339339
value = &group_long;
340340
}
341341

342-
if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
343-
RETURN_TRUE;
344-
} else {
345-
RETURN_FALSE;
346-
}
342+
RETURN_BOOL(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL));
347343
} else {
348344
#ifndef PHP_WIN32
349345
/* On Windows, we expect regular chgrp to fail silently by default */
@@ -480,11 +476,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
480476
value = &user_long;
481477
}
482478

483-
if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
484-
RETURN_TRUE;
485-
} else {
486-
RETURN_FALSE;
487-
}
479+
RETURN_BOOL(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL));
488480
} else {
489481
#ifndef PHP_WIN32
490482
/* On Windows, we expect regular chown to fail silently by default */
@@ -638,11 +630,7 @@ PHP_FUNCTION(touch)
638630
wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
639631
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
640632
if(wrapper && wrapper->wops->stream_metadata) {
641-
if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL)) {
642-
RETURN_TRUE;
643-
} else {
644-
RETURN_FALSE;
645-
}
633+
RETURN_BOOL(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL));
646634
} else {
647635
php_stream *stream;
648636
if(!filetime_is_null || !fileatime_is_null) {

0 commit comments

Comments
 (0)