Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add brackets after if when the content of the if block is a macro to avoir an issue if the macro is changed to multiline in the futur
Baptiste Daroussin committed 10 years ago
commit 10dd6ef0d9cde23eb9e1fe4de6749c99ccda3ec6
parent 5c6e825
1 file changed +12 -6
modified libpkg/pkgdb.c
@@ -1177,14 +1177,16 @@ pkgdb_transaction_begin_sqlite(sqlite3 *sqlite, const char *savepoint)
					 &stmt, NULL);
	}

-
	if (ret == SQLITE_OK)
+
	if (ret == SQLITE_OK) {
		PKGDB_SQLITE_RETRY_ON_BUSY(ret)
			ret = sqlite3_step(stmt);
+
	}

	sqlite3_finalize(stmt);

-
	if (ret != SQLITE_OK && ret != SQLITE_DONE)
+
	if (ret != SQLITE_OK && ret != SQLITE_DONE) {
		ERROR_SQLITE(sqlite, psql);
+
	}

	return (ret == SQLITE_OK || ret == SQLITE_DONE ? EPKG_OK : EPKG_FATAL);
}
@@ -1217,14 +1219,16 @@ pkgdb_transaction_commit_sqlite(sqlite3 *sqlite, const char *savepoint)
					 &stmt, NULL);
	}

-
	if (ret == SQLITE_OK)
+
	if (ret == SQLITE_OK) {
		PKGDB_SQLITE_RETRY_ON_BUSY(ret)
			ret = sqlite3_step(stmt);
+
	}

	sqlite3_finalize(stmt);

-
	if (ret != SQLITE_OK && ret != SQLITE_DONE)
+
	if (ret != SQLITE_OK && ret != SQLITE_DONE) {
		ERROR_SQLITE(sqlite, psql);
+
	}

	return (ret == SQLITE_OK || ret == SQLITE_DONE ? EPKG_OK : EPKG_FATAL);
}
@@ -1256,14 +1260,16 @@ pkgdb_transaction_rollback_sqlite(sqlite3 *sqlite, const char *savepoint)
					 &stmt, NULL);
	}

-
	if (ret == SQLITE_OK)
+
	if (ret == SQLITE_OK) {
		PKGDB_SQLITE_RETRY_ON_BUSY(ret)
			ret = sqlite3_step(stmt);
+
	}

	sqlite3_finalize(stmt);

-
	if (ret != SQLITE_OK && ret != SQLITE_DONE)
+
	if (ret != SQLITE_OK && ret != SQLITE_DONE) {
		ERROR_SQLITE(sqlite, psql);
+
	}

	return (ret == SQLITE_OK || ret == SQLITE_DONE ? EPKG_OK : EPKG_FATAL);
}