summaryrefslogtreecommitdiffstats
path: root/kbx/keybox-update.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-04-01 11:10:47 +0200
committerWerner Koch <wk@gnupg.org>2017-04-01 11:10:47 +0200
commit0039d7107bcdfce6f3b02b46ff0495cfba07882a (patch)
treec68d3fb046ecc0a03e37a18b2ed54113bcb2b613 /kbx/keybox-update.c
parentgpg: Avoid multiple open calls to the keybox file. (diff)
downloadgnupg2-0039d7107bcdfce6f3b02b46ff0495cfba07882a.tar.xz
gnupg2-0039d7107bcdfce6f3b02b46ff0495cfba07882a.zip
kbx: Unify blob reading functions.
* kbx/keybox-file.c (_keybox_read_blob): Remove. (_keybox_read_blob2): Rename to .... (_keybox_read_blob): this. Make arg options. Change all callers. * kbx/keybox-search.c (keybox_search): Factor fopen call out to ... (open_file): new. (keybox_seek): Als use open_file. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to '')
-rw-r--r--kbx/keybox-update.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kbx/keybox-update.c b/kbx/keybox-update.c
index 0b0f56bce..580330f52 100644
--- a/kbx/keybox-update.c
+++ b/kbx/keybox-update.c
@@ -288,7 +288,7 @@ blob_filecopy (int mode, const char *fname, KEYBOXBLOB blob,
}
/* Skip this blob. */
- rc = _keybox_read_blob (NULL, fp);
+ rc = _keybox_read_blob (NULL, fp, NULL);
if (rc)
{
fclose (fp);
@@ -665,7 +665,7 @@ keybox_compress (KEYBOX_HANDLE hd)
/* A quick test to see if we need to compress the file at all. We
schedule a compress run after 3 hours. */
- if ( !_keybox_read_blob (&blob, fp) )
+ if ( !_keybox_read_blob (&blob, fp, NULL) )
{
const unsigned char *buffer;
size_t length;
@@ -703,7 +703,7 @@ keybox_compress (KEYBOX_HANDLE hd)
cut_time = time(NULL) - 86400;
first_blob = 1;
skipped_deleted = 0;
- for (rc=0; !(read_rc = _keybox_read_blob2 (&blob, fp, &skipped_deleted));
+ for (rc=0; !(read_rc = _keybox_read_blob (&blob, fp, &skipped_deleted));
_keybox_release_blob (blob), blob = NULL )
{
unsigned int blobflags;