Skip to content

Commit a84523d

Browse files
committed
Voidify PDO's closer handler
1 parent dd578f7 commit a84523d

File tree

8 files changed

+8
-18
lines changed

8 files changed

+8
-18
lines changed

ext/pdo/php_pdo_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ typedef struct {
226226
/* {{{ methods for a database handle */
227227

228228
/* close or otherwise disconnect the database */
229-
typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh);
229+
typedef void (*pdo_dbh_close_func)(pdo_dbh_t *dbh);
230230

231231
/* prepare a statement and stash driver specific portion into stmt */
232232
typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options);

ext/pdo_dblib/dblib_driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
7474
}
7575

7676

77-
static int dblib_handle_closer(pdo_dbh_t *dbh)
77+
static void dblib_handle_closer(pdo_dbh_t *dbh)
7878
{
7979
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
8080

@@ -91,7 +91,6 @@ static int dblib_handle_closer(pdo_dbh_t *dbh)
9191
pefree(H, dbh->is_persistent);
9292
dbh->driver_data = NULL;
9393
}
94-
return 0;
9594
}
9695

9796
static int dblib_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)

ext/pdo_firebird/firebird_driver.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_lo
467467
#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__)
468468

469469
/* called by PDO to close a db handle */
470-
static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
470+
static void firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
471471
{
472472
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
473473

@@ -498,8 +498,6 @@ static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
498498
}
499499

500500
pefree(H, dbh->is_persistent);
501-
502-
return 0;
503501
}
504502
/* }}} */
505503

ext/pdo_mysql/mysql_driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
141141
/* }}} */
142142

143143
/* {{{ mysql_handle_closer */
144-
static int mysql_handle_closer(pdo_dbh_t *dbh)
144+
static void mysql_handle_closer(pdo_dbh_t *dbh)
145145
{
146146
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
147147

@@ -157,7 +157,6 @@ static int mysql_handle_closer(pdo_dbh_t *dbh)
157157
pefree(H, dbh->is_persistent);
158158
dbh->driver_data = NULL;
159159
}
160-
PDO_DBG_RETURN(0);
161160
}
162161
/* }}} */
163162

ext/pdo_oci/oci_driver.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
185185
}
186186
/* }}} */
187187

188-
static int oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
188+
static void oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
189189
{
190190
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
191191

@@ -233,8 +233,6 @@ static int oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
233233
}
234234

235235
pefree(H, dbh->is_persistent);
236-
237-
return 0;
238236
}
239237
/* }}} */
240238

ext/pdo_odbc/odbc_driver.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
120120
}
121121
/* }}} */
122122

123-
static int odbc_handle_closer(pdo_dbh_t *dbh)
123+
static void odbc_handle_closer(pdo_dbh_t *dbh)
124124
{
125125
pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data;
126126

@@ -134,8 +134,6 @@ static int odbc_handle_closer(pdo_dbh_t *dbh)
134134
H->env = NULL;
135135
pefree(H, dbh->is_persistent);
136136
dbh->driver_data = NULL;
137-
138-
return 0;
139137
}
140138

141139
static int odbc_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_options)

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid)
203203
}
204204
/* }}} */
205205

206-
static int pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
206+
static void pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
207207
{
208208
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
209209
if (H) {
@@ -218,7 +218,6 @@ static int pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
218218
pefree(H, dbh->is_persistent);
219219
dbh->driver_data = NULL;
220220
}
221-
return 0;
222221
}
223222
/* }}} */
224223

ext/pdo_sqlite/sqlite_driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H)
148148
}
149149
}
150150

151-
static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
151+
static void sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
152152
{
153153
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
154154

@@ -171,7 +171,6 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
171171
pefree(H, dbh->is_persistent);
172172
dbh->driver_data = NULL;
173173
}
174-
return 0;
175174
}
176175
/* }}} */
177176

0 commit comments

Comments
 (0)