aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/utils
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-15 14:21:49 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-15 14:22:57 +0100
commit8c515272c3e82c2400b15b5bfefa9dd883b86b96 (patch)
tree46704138b1f39b96daf1e92fa5eedbbe27ad9d09 /openbsc/src/utils
parent961bd0b121d604612ea27bd2c83edd73290b2cb6 (diff)
meas: Do not retry to close the database
There is no concurrency involved and if it failed the first time, it will fail the second, third, ... time as well. Simply print that we will leak the database instance.
Diffstat (limited to 'openbsc/src/utils')
-rw-r--r--openbsc/src/utils/meas_db.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/openbsc/src/utils/meas_db.c b/openbsc/src/utils/meas_db.c
index 6c7e7ae6e..a3b694e6b 100644
--- a/openbsc/src/utils/meas_db.c
+++ b/openbsc/src/utils/meas_db.c
@@ -314,7 +314,6 @@ err_io:
void meas_db_close(struct meas_db_state *st)
{
- int retries;
if (sqlite3_finalize(st->stmt_ins_mr) != SQLITE_OK)
fprintf(stderr, "DB insert measurement report finalize error: %s\n",
sqlite3_errmsg(st->db));
@@ -324,16 +323,8 @@ void meas_db_close(struct meas_db_state *st)
if (sqlite3_finalize(st->stmt_upd_mr) != SQLITE_OK)
fprintf(stderr, "DB update measurement report finalize error: %s\n",
sqlite3_errmsg(st->db));
- retries = 0;
- while (1) {
- if (sqlite3_close(st->db) == SQLITE_OK)
- break;
- if ((++retries) >= 3) {
- fprintf(stderr, "Unable to close DB, abandoning.\n");
- break;
- }
- sleep(1);
- }
+ if (sqlite3_close(st->db) != SQLITE_OK)
+ fprintf(stderr, "Unable to close DB, abandoning.\n");
talloc_free(st);