aboutsummaryrefslogtreecommitdiffstats
path: root/kbx/keybox-search.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-05-04 09:55:26 +0000
committerWerner Koch <[email protected]>2023-05-04 12:37:48 +0000
commita7dbf11954873c6c58a36b57028ced4ecd45bdc6 (patch)
treed24ae94b8a122285290ed31273e62fa7e4d78b68 /kbx/keybox-search.c
parentgpgsm: Cache the non-existence of the policy file. (diff)
downloadgnupg-a7dbf11954873c6c58a36b57028ced4ecd45bdc6.tar.gz
gnupg-a7dbf11954873c6c58a36b57028ced4ecd45bdc6.zip
kbx: Add extra flags to fopen for use by Windows.
* kbx/keybox-search.c (open_file): Use sysopen and sequential. * kbx/keybox-update.c (create_tmp_file): Ditto. (blob_filecopy): Ditto. (keybox_set_flags): Ditto. (keybox_delete): Ditto. (keybox_compress): Ditto. -- Under Windows "sysopen" requests that direct API calls (CreateFile et al.) are used instead of the libc wrappers. This may or may not improve the performance. Using "sequential" is a hint to Windows to assume that a file is in general access in a sequential manner. This will have an affect only with a future libgpg-error.
Diffstat (limited to 'kbx/keybox-search.c')
-rw-r--r--kbx/keybox-search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kbx/keybox-search.c b/kbx/keybox-search.c
index 8dea7cb8e..7645fba4f 100644
--- a/kbx/keybox-search.c
+++ b/kbx/keybox-search.c
@@ -878,7 +878,7 @@ static gpg_error_t
open_file (KEYBOX_HANDLE hd)
{
- hd->fp = es_fopen (hd->kb->fname, "rb");
+ hd->fp = es_fopen (hd->kb->fname, "rb,sysopen,sequential");
if (!hd->fp)
{
hd->error = gpg_error_from_syserror ();