mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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>
This commit is contained in:
parent
5556eca5ac
commit
0039d7107b
5 changed files with 54 additions and 37 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue