summaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-10-20 11:52:16 +0200
committerWerner Koch <wk@gnupg.org>2020-10-20 12:15:56 +0200
commit390497ea115e1aca93feec297a5bd6ae7b1ba6dd (patch)
tree675448ff809e3f333bba4918e4787eacda7f8190 /g10/tdbio.c
parentReplace all calls to access by gnupg_access (diff)
downloadgnupg2-390497ea115e1aca93feec297a5bd6ae7b1ba6dd.tar.xz
gnupg2-390497ea115e1aca93feec297a5bd6ae7b1ba6dd.zip
Replace most of the remaining stdio calls by estream calls.
-- We need to use es_fopen on Windows to cope with non-ascii file names. This is quite a large but fortunately straightforward change. At a very few places we keep using stdio (for example due to the use of popen). GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 2b2944fdd..fdb90ec53 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -725,7 +725,7 @@ tdbio_set_dbname (ctrl_t ctrl, const char *new_dbname,
|| stat (fname, &statbuf)
|| statbuf.st_size == 0)
{
- FILE *fp;
+ estream_t fp;
TRUSTREC rec;
int rc;
mode_t oldmask;
@@ -747,11 +747,11 @@ tdbio_set_dbname (ctrl_t ctrl, const char *new_dbname,
gpg_err_set_errno (EPERM);
}
else
- fp = fopen (fname, "wb");
+ fp = es_fopen (fname, "wb");
umask(oldmask);
if (!fp)
log_fatal (_("can't create '%s': %s\n"), fname, strerror (errno));
- fclose (fp);
+ es_fclose (fp);
db_fd = open (db_name, O_RDWR | MY_O_BINARY);
if (db_fd == -1)