From: Jonathan McDowell Date: Mon, 2 Apr 2012 17:50:21 +0000 (-0700) Subject: Add keyid to DB4 backend deletion error messages X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/commitdiff_plain/5633e41c3ef6f5eb99308dd21ea0b4a3205be797?ds=sidebyside Add keyid to DB4 backend deletion error messages We display an error when we fail to delete an entry from the worddb or similar, but weren't including the keyid so this wasn't very useful. --- diff --git a/keydb_db4.c b/keydb_db4.c index 065fb5b..4e35bff 100644 --- a/keydb_db4.c +++ b/keydb_db4.c @@ -887,7 +887,7 @@ static int db4_delete_key(uint64_t keyid, bool intrans) worddb_data[ 8] = (keyid >> 24) & 0xFF; worddb_data[ 9] = (keyid >> 16) & 0xFF; worddb_data[10] = (keyid >> 8) & 0xFF; - worddb_data[11] = keyid & 0xFF; + worddb_data[11] = keyid & 0xFF; ret = cursor->c_get(cursor, &key, @@ -896,17 +896,14 @@ static int db4_delete_key(uint64_t keyid, bool intrans) if (ret == 0) { ret = cursor->c_del(cursor, 0); - if (ret != 0) { - logthing(LOGTHING_ERROR, - "Problem deleting word: %s", - db_strerror(ret)); - } } if (ret != 0) { logthing(LOGTHING_ERROR, - "Problem deleting word: %s", - db_strerror(ret)); + "Problem deleting word: %s " + "(0x%016" PRIX64 ")", + db_strerror(ret), + keyid); if (ret == DB_LOCK_DEADLOCK) { deadlock = true; } @@ -951,17 +948,14 @@ static int db4_delete_key(uint64_t keyid, bool intrans) if (ret == 0) { ret = cursor->c_del(cursor, 0); - if (ret != 0) { - logthing(LOGTHING_ERROR, - "Problem deleting short keyid: %s", - db_strerror(ret)); - } } if (ret != 0) { logthing(LOGTHING_ERROR, - "Problem deleting short keyid: %s", - db_strerror(ret)); + "Problem deleting short keyid: %s ", + "(0x%016" PRIX64 ")", + db_strerror(ret), + keyid); if (ret == DB_LOCK_DEADLOCK) { deadlock = true; } @@ -986,18 +980,14 @@ static int db4_delete_key(uint64_t keyid, bool intrans) if (ret == 0) { ret = cursor->c_del(cursor, 0); - if (ret != 0) { - logthing(LOGTHING_ERROR, - "Problem deleting short" - " keyid: %s", - db_strerror(ret)); - } } if (ret != 0) { logthing(LOGTHING_ERROR, - "Problem deleting short keyid: %s", - db_strerror(ret)); + "Problem deleting short keyid: %s ", + "(0x%016" PRIX64 ")", + db_strerror(ret), + keyid); if (ret == DB_LOCK_DEADLOCK) { deadlock = true; } @@ -1037,8 +1027,10 @@ static int db4_delete_key(uint64_t keyid, bool intrans) if (ret != 0) { logthing(LOGTHING_ERROR, - "Problem deleting skshash: %s", - db_strerror(ret)); + "Problem deleting skshash: %s ", + "(0x%016" PRIX64 ")", + db_strerror(ret), + keyid); if (ret == DB_LOCK_DEADLOCK) { deadlock = true; }