mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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>
Backported-from-master: 390497ea11
This commit is contained in:
parent
dd5fd4a760
commit
5c6e9b44cc
20 changed files with 208 additions and 197 deletions
|
@ -782,7 +782,7 @@ static gpg_error_t
|
|||
open_file (KEYBOX_HANDLE hd)
|
||||
{
|
||||
|
||||
hd->fp = fopen (hd->kb->fname, "rb");
|
||||
hd->fp = es_fopen (hd->kb->fname, "rb");
|
||||
if (!hd->fp)
|
||||
{
|
||||
hd->error = gpg_error_from_syserror ();
|
||||
|
@ -814,11 +814,11 @@ keybox_search_reset (KEYBOX_HANDLE hd)
|
|||
|
||||
if (hd->fp)
|
||||
{
|
||||
if (fseeko (hd->fp, 0, SEEK_SET))
|
||||
if (es_fseeko (hd->fp, 0, SEEK_SET))
|
||||
{
|
||||
/* Ooops. Seek did not work. Close so that the search will
|
||||
* open the file again. */
|
||||
fclose (hd->fp);
|
||||
es_fclose (hd->fp);
|
||||
hd->fp = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -909,7 +909,7 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc,
|
|||
* returned a blob which also was not the first one. We now
|
||||
* need to skip over that blob and hope that the file has
|
||||
* not changed. */
|
||||
if (fseeko (hd->fp, lastfoundoff, SEEK_SET))
|
||||
if (es_fseeko (hd->fp, lastfoundoff, SEEK_SET))
|
||||
{
|
||||
rc = gpg_error_from_syserror ();
|
||||
log_debug ("%s: seeking to last found offset failed: %s\n",
|
||||
|
@ -1285,7 +1285,7 @@ keybox_offset (KEYBOX_HANDLE hd)
|
|||
{
|
||||
if (!hd->fp)
|
||||
return 0;
|
||||
return ftello (hd->fp);
|
||||
return es_ftello (hd->fp);
|
||||
}
|
||||
|
||||
gpg_error_t
|
||||
|
@ -1310,7 +1310,7 @@ keybox_seek (KEYBOX_HANDLE hd, off_t offset)
|
|||
return err;
|
||||
}
|
||||
|
||||
err = fseeko (hd->fp, offset, SEEK_SET);
|
||||
err = es_fseeko (hd->fp, offset, SEEK_SET);
|
||||
hd->error = gpg_error_from_errno (err);
|
||||
|
||||
return hd->error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue