From 6728c1bd72f2ddb46528a0c61ac833b1036a12a2 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Wed, 23 Dec 2020 01:49:56 +0100 Subject: [PATCH] Formalize pdo_dbh_check_liveness_func() return type to zend_result --- ext/pdo/php_pdo_driver.h | 2 +- ext/pdo_mysql/mysql_driver.c | 2 +- ext/pdo_oci/oci_driver.c | 2 +- ext/pdo_pgsql/pgsql_driver.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 8345d7f81e0..a8478cb3a60 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -265,7 +265,7 @@ typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val); /* checking/pinging persistent connections; return SUCCESS if the connection * is still alive and ready to be used, FAILURE otherwise. * You may set this handler to NULL, which is equivalent to returning SUCCESS. */ -typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh); +typedef zend_result (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh); /* called at request end for each persistent dbh; this gives the driver * the opportunity to safely release resources that only have per-request diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 830104952a9..869f0ef441a 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -520,7 +520,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_ /* }}} */ /* {{{ pdo_mysql_check_liveness */ -static int pdo_mysql_check_liveness(pdo_dbh_t *dbh) +static zend_result pdo_mysql_check_liveness(pdo_dbh_t *dbh) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index 18faa538b9e..9cf894e9f26 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -651,7 +651,7 @@ static int oci_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return } /* }}} */ -static int pdo_oci_check_liveness(pdo_dbh_t *dbh) /* {{{ */ +static zend_result pdo_oci_check_liveness(pdo_dbh_t *dbh) /* {{{ */ { pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; sb4 error_code = 0; diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 3ae15e75117..62ad40c256f 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -488,7 +488,7 @@ static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_ } /* {{{ */ -static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh) +static zend_result pdo_pgsql_check_liveness(pdo_dbh_t *dbh) { pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; if (!PQconsumeInput(H->server) || PQstatus(H->server) == CONNECTION_BAD) {