From: Kalle Sommer Nielsen Date: Thu, 20 Oct 2016 08:56:08 +0000 (+0200) Subject: Ignore the return value of sqlite3->busyTimeout() if their "API Armor" is not enabled. X-Git-Tag: php-7.2.0alpha1~1069 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ca38e8cf8a4fa4b11a4a92131ef8f476659b7a9;p=php Ignore the return value of sqlite3->busyTimeout() if their "API Armor" is not enabled. The sqlite3_busy_timeout() function can only ever return SQLITE_OK if the armor is not compiled in, which means we can skip this error check --- diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 601b0e8e18..969eb310a1 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -306,7 +306,9 @@ PHP_METHOD(sqlite3, busyTimeout) php_sqlite3_db_object *db_obj; zval *object = getThis(); zend_long ms; +#ifdef SQLITE_ENABLE_API_ARMOR int return_code; +#endif db_obj = Z_SQLITE3_DB_P(object); SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3) @@ -315,11 +317,15 @@ PHP_METHOD(sqlite3, busyTimeout) return; } +#ifdef SQLITE_ENABLE_API_ARMOR return_code = sqlite3_busy_timeout(db_obj->db, ms); if (return_code != SQLITE_OK) { php_sqlite3_error(db_obj, "Unable to set busy timeout: %d, %s", return_code, sqlite3_errmsg(db_obj->db)); RETURN_FALSE; } +#else + php_ignore_value(sqlite3_busy_timeout(db_obj->db, ms)); +#endif RETURN_TRUE; }