diff options
author | Werner Koch <[email protected]> | 2017-04-01 09:10:47 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-04-01 09:10:47 +0000 |
commit | 0039d7107bcdfce6f3b02b46ff0495cfba07882a (patch) | |
tree | c68d3fb046ecc0a03e37a18b2ed54113bcb2b613 /kbx/keybox-dump.c | |
parent | gpg: Avoid multiple open calls to the keybox file. (diff) | |
download | gnupg-0039d7107bcdfce6f3b02b46ff0495cfba07882a.tar.gz gnupg-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 <[email protected]>
Diffstat (limited to 'kbx/keybox-dump.c')
-rw-r--r-- | kbx/keybox-dump.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kbx/keybox-dump.c b/kbx/keybox-dump.c index d24f117ab..aa1d93be7 100644 --- a/kbx/keybox-dump.c +++ b/kbx/keybox-dump.c @@ -581,7 +581,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp) for (;;) { - rc = _keybox_read_blob (&blob, fp); + rc = _keybox_read_blob (&blob, fp, NULL); if (gpg_err_code (rc) == GPG_ERR_TOO_LARGE && gpg_err_source (rc) == GPG_ERR_SOURCE_KEYBOX) { @@ -704,7 +704,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp) } dupitems_count = 0; - while ( !(rc = _keybox_read_blob (&blob, fp)) ) + while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) ) { unsigned char digest[20]; @@ -778,7 +778,7 @@ _keybox_dump_cut_records (const char *filename, unsigned long from, if (!(fp = open_file (&filename, stderr))) return gpg_error_from_syserror (); - while ( !(rc = _keybox_read_blob (&blob, fp)) ) + while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) ) { if (recno > to) break; /* Ready. */ |