summaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index d1b5ed32a..75687a3b0 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -782,9 +782,9 @@ upd_hashtable( ulong table, byte *key, int keylen, ulong newrecnum )
hashrec += msb / ITEMS_PER_HTBL_RECORD;
rc = tdbio_read_record( hashrec, &rec, RECTYPE_HTBL );
if( rc ) {
- log_error( db_name, "upd_hashtable: read failed: %s\n",
- gpg_strerror (rc) );
- return rc;
+ log_error ("upd_hashtable in `%s': read failed: %s\n", db_name,
+ gpg_strerror (rc) );
+ return rc;
}
item = rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD];
@@ -792,8 +792,8 @@ upd_hashtable( ulong table, byte *key, int keylen, ulong newrecnum )
rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = newrecnum;
rc = tdbio_write_record( &rec );
if( rc ) {
- log_error( db_name, "upd_hashtable: write htbl failed: %s\n",
- gpg_strerror (rc) );
+ log_error ("upd_hashtable in `%s': write htbl failed: %s\n",
+ db_name, gpg_strerror (rc) );
return rc;
}
}
@@ -931,8 +931,8 @@ drop_from_hashtable( ulong table, byte *key, int keylen, ulong recnum )
hashrec += msb / ITEMS_PER_HTBL_RECORD;
rc = tdbio_read_record( hashrec, &rec, RECTYPE_HTBL );
if( rc ) {
- log_error( db_name, "drop_from_hashtable: read failed: %s\n",
- gpg_strerror (rc) );
+ log_error ("drop_from_hashtable `%s': read failed: %s\n",
+ db_name, gpg_strerror (rc) );
return rc;
}
@@ -944,8 +944,8 @@ drop_from_hashtable( ulong table, byte *key, int keylen, ulong recnum )
rec.r.htbl.item[msb % ITEMS_PER_HTBL_RECORD] = 0;
rc = tdbio_write_record( &rec );
if( rc )
- log_error( db_name, "drop_from_hashtable: write htbl failed: %s\n",
- gpg_strerror (rc) );
+ log_error ("drop_from_hashtable `%s': write htbl failed: %s\n",
+ db_name, gpg_strerror (rc) );
return rc;
}
@@ -973,8 +973,9 @@ drop_from_hashtable( ulong table, byte *key, int keylen, ulong recnum )
rec.r.hlst.rnum[i] = 0; /* drop */
rc = tdbio_write_record( &rec );
if( rc )
- log_error( db_name, "drop_from_hashtable: write htbl failed: %s\n",
- gpg_strerror (rc) );
+ log_error ("drop_from_hashtable `%s': "
+ "write htbl failed: %s\n",
+ db_name, gpg_strerror (rc) );
return rc;
}
}
@@ -1020,7 +1021,8 @@ lookup_hashtable( ulong table, const byte *key, size_t keylen,
hashrec += msb / ITEMS_PER_HTBL_RECORD;
rc = tdbio_read_record( hashrec, rec, RECTYPE_HTBL );
if( rc ) {
- log_error( db_name, "lookup_hashtable failed: %s\n", gpg_strerror (rc) );
+ log_error ("lookup_hashtable in `%s' failed: %s\n",
+ db_name, gpg_strerror (rc) );
return rc;
}
@@ -1030,14 +1032,15 @@ lookup_hashtable( ulong table, const byte *key, size_t keylen,
rc = tdbio_read_record( item, rec, 0 );
if( rc ) {
- log_error( db_name, "hashtable read failed: %s\n", gpg_strerror (rc) );
+ log_error ("hashtable `%s' read failed: %s\n",
+ db_name, gpg_strerror (rc) );
return rc;
}
if( rec->rectype == RECTYPE_HTBL ) {
hashrec = item;
level++;
if( level >= keylen ) {
- log_error( db_name, "hashtable has invalid indirections\n");
+ log_error ("hashtable `%s' has invalid indirections\n", db_name);
return GPG_ERR_TRUSTDB;
}
goto next_level;