summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-12-24 01:08:06 +0100
committerGeorge Peter Banyard <girgias@php.net>2021-01-06 10:20:57 +0000
commit53ba72ec03b05800de94c3e4f3f8c96aae70185d (patch)
tree7d719d289014337db5a7d6fd0e6015710c5ee320
parent954d3743cce0390f4435cf118d20b84a7320a836 (diff)
downloadphp-git-53ba72ec03b05800de94c3e4f3f8c96aae70185d.tar.gz
Voidify PDO's closer handler
-rw-r--r--ext/pdo/php_pdo_driver.h2
-rw-r--r--ext/pdo_dblib/dblib_driver.c3
-rw-r--r--ext/pdo_firebird/firebird_driver.c4
-rw-r--r--ext/pdo_mysql/mysql_driver.c3
-rw-r--r--ext/pdo_oci/oci_driver.c4
-rw-r--r--ext/pdo_odbc/odbc_driver.c4
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c3
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c3
8 files changed, 8 insertions, 18 deletions
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index 2eebe6103f..044761a134 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -226,7 +226,7 @@ typedef struct {
/* {{{ methods for a database handle */
/* close or otherwise disconnect the database */
-typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh);
+typedef void (*pdo_dbh_close_func)(pdo_dbh_t *dbh);
/* prepare a statement and stash driver specific portion into stmt */
typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options);
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 4e925db18f..9806752ac5 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -74,7 +74,7 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
}
-static int dblib_handle_closer(pdo_dbh_t *dbh)
+static void dblib_handle_closer(pdo_dbh_t *dbh)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -91,7 +91,6 @@ static int dblib_handle_closer(pdo_dbh_t *dbh)
pefree(H, dbh->is_persistent);
dbh->driver_data = NULL;
}
- return 0;
}
static int dblib_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index a0b84cd13f..6103f3fede 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -467,7 +467,7 @@ void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_lo
#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__)
/* called by PDO to close a db handle */
-static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
+static void firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -498,8 +498,6 @@ static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
}
pefree(H, dbh->is_persistent);
-
- return 0;
}
/* }}} */
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 7ebdc976cf..3d3f9b2b8d 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -141,7 +141,7 @@ static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
/* }}} */
/* {{{ mysql_handle_closer */
-static int mysql_handle_closer(pdo_dbh_t *dbh)
+static void mysql_handle_closer(pdo_dbh_t *dbh)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
@@ -157,7 +157,6 @@ static int mysql_handle_closer(pdo_dbh_t *dbh)
pefree(H, dbh->is_persistent);
dbh->driver_data = NULL;
}
- PDO_DBG_RETURN(0);
}
/* }}} */
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index af3d6b7539..2b22ee683d 100644
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -185,7 +185,7 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
}
/* }}} */
-static int oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
+static void oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -233,8 +233,6 @@ static int oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
}
pefree(H, dbh->is_persistent);
-
- return 0;
}
/* }}} */
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index e9a8b640cb..42f77c7397 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -120,7 +120,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
}
/* }}} */
-static int odbc_handle_closer(pdo_dbh_t *dbh)
+static void odbc_handle_closer(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data;
@@ -134,8 +134,6 @@ static int odbc_handle_closer(pdo_dbh_t *dbh)
H->env = NULL;
pefree(H, dbh->is_persistent);
dbh->driver_data = NULL;
-
- return 0;
}
static int odbc_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 8cd318772f..121bdc3409 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -203,7 +203,7 @@ php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid)
}
/* }}} */
-static int pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
+static void pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (H) {
@@ -218,7 +218,6 @@ static int pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
pefree(H, dbh->is_persistent);
dbh->driver_data = NULL;
}
- return 0;
}
/* }}} */
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 9998ef2d20..8e1ea1d2b3 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -148,7 +148,7 @@ static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H)
}
}
-static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
+static void sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
@@ -171,7 +171,6 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
pefree(H, dbh->is_persistent);
dbh->driver_data = NULL;
}
- return 0;
}
/* }}} */