1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Replace all calls to stat by gnupg_stat.

* common/sysutils.c (gnupg_stat): New.
* common/sysutils.h: Include sys/stat.h.
--

Yet another wrapper for Unicode support on Windows.

GnuPG-bug-id: 5098
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-10-20 16:38:06 +02:00
parent 4dcef0e178
commit 18e5dd7b03
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
22 changed files with 82 additions and 33 deletions

View file

@ -103,7 +103,7 @@ register_secured_file (const char *fname)
struct secured_file_item *sf;
/* Note that we stop immediately if something goes wrong here. */
if (stat (fname, &buf))
if (gnupg_stat (fname, &buf))
log_fatal (_("fstat of '%s' failed in %s: %s\n"), fname,
"register_secured_file", strerror (errno));
/* log_debug ("registering '%s' i=%lu.%lu\n", fname, */
@ -132,7 +132,7 @@ unregister_secured_file (const char *fname)
struct stat buf;
struct secured_file_item *sf, *sfprev;
if (stat (fname, &buf))
if (gnupg_stat (fname, &buf))
{
log_error (_("fstat of '%s' failed in %s: %s\n"), fname,
"unregister_secured_file", strerror (errno));
@ -206,7 +206,7 @@ is_secured_filename (const char *fname)
/* Note that we print out a error here and claim that a file is
secure if something went wrong. */
if (stat (fname, &buf))
if (gnupg_stat (fname, &buf))
{
if (errno == ENOENT || errno == EPERM || errno == EACCES)
return 0;