diff options
author | Werner Koch <wk@gnupg.org> | 2017-04-01 11:10:47 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-04-01 11:10:47 +0200 |
commit | 0039d7107bcdfce6f3b02b46ff0495cfba07882a (patch) | |
tree | c68d3fb046ecc0a03e37a18b2ed54113bcb2b613 /kbx/keybox-update.c | |
parent | gpg: Avoid multiple open calls to the keybox file. (diff) | |
download | gnupg2-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.c | 6 |
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; |