Skip to content

Commit 26c432d

Browse files
authored
ext/posix: changing helpers return to zend_result. (php#13957)
1 parent 72b2524 commit 26c432d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ext/posix/posix.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,14 @@ PHP_FUNCTION(posix_ctermid)
416416
/* }}} */
417417

418418
/* Checks if the provides resource is a stream and if it provides a file descriptor */
419-
static int php_posix_stream_get_fd(zval *zfp, zend_long *fd) /* {{{ */
419+
static zend_result php_posix_stream_get_fd(zval *zfp, zend_long *fd) /* {{{ */
420420
{
421421
php_stream *stream;
422422

423423
php_stream_from_zval_no_verify(stream, zfp);
424424

425425
if (stream == NULL) {
426-
return 0;
426+
return FAILURE;
427427
}
428428

429429
/* get the fd.
@@ -437,9 +437,9 @@ static int php_posix_stream_get_fd(zval *zfp, zend_long *fd) /* {{{ */
437437
} else {
438438
php_error_docref(NULL, E_WARNING, "Could not use stream of type '%s'",
439439
stream->ops->label);
440-
return 0;
440+
return FAILURE;
441441
}
442-
return 1;
442+
return SUCCESS;
443443
}
444444
/* }}} */
445445

@@ -459,7 +459,7 @@ PHP_FUNCTION(posix_ttyname)
459459
ZEND_PARSE_PARAMETERS_END();
460460

461461
if (Z_TYPE_P(z_fd) == IS_RESOURCE) {
462-
if (!php_posix_stream_get_fd(z_fd, &fd)) {
462+
if (php_posix_stream_get_fd(z_fd, &fd) == FAILURE) {
463463
RETURN_FALSE;
464464
}
465465
} else {
@@ -520,7 +520,7 @@ PHP_FUNCTION(posix_isatty)
520520
ZEND_PARSE_PARAMETERS_END();
521521

522522
if (Z_TYPE_P(z_fd) == IS_RESOURCE) {
523-
if (!php_posix_stream_get_fd(z_fd, &fd)) {
523+
if (php_posix_stream_get_fd(z_fd, &fd) == FAILURE) {
524524
RETURN_FALSE;
525525
}
526526
} else {
@@ -1044,7 +1044,7 @@ PHP_FUNCTION(posix_getpwuid)
10441044
#define UNLIMITED_STRING "unlimited"
10451045

10461046
/* {{{ posix_addlimit */
1047-
static int posix_addlimit(int limit, const char *name, zval *return_value) {
1047+
static zend_result posix_addlimit(int limit, const char *name, zval *return_value) {
10481048
int result;
10491049
struct rlimit rl;
10501050
char hard[80];
@@ -1316,7 +1316,7 @@ PHP_FUNCTION(posix_fpathconf)
13161316
ZEND_PARSE_PARAMETERS_END();
13171317

13181318
if (Z_TYPE_P(z_fd) == IS_RESOURCE) {
1319-
if (!php_posix_stream_get_fd(z_fd, &fd)) {
1319+
if (php_posix_stream_get_fd(z_fd, &fd) == FAILURE) {
13201320
RETURN_FALSE;
13211321
}
13221322
} else {

0 commit comments

Comments
 (0)